473,320 Members | 1,926 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Adding a function to an interface????

Hello everyone,

I need your help, how could you add a function to an interface... i'll give you an example.

i have to add a new public function to an interface that i have here called
PaidHoliday
Data type returned: Double
and the parameters: CurrentYear

Do i have to use an example of this :

Function PaidHoliday (ByVal currentYear As Integer) As Double

But how to finish it???

Thank you
Nov 15 '06 #1
2 1066
albertw
267 100+
Hello everyone,

I need your help, how could you add a function to an interface... i'll give you an example.

i have to add a new public function to an interface that i have here called
PaidHoliday
Data type returned: Double
and the parameters: CurrentYear

Do i have to use an example of this :

Function PaidHoliday (ByVal currentYear As Integer) As Double

But how to finish it???

Thank you
hi there

note that you may only use the Public Statement in Modules ! otherwise change to private

call your function as Answer=PaidHoliday(2006) , where Answer should be declared as double

do some calculations is the function otherwise you won't get paid :)
maybe add some Errortrap

finish with End Function
Nov 15 '06 #2
willakawill
1,646 1GB
Hello everyone,

I need your help, how could you add a function to an interface... i'll give you an example.

i have to add a new public function to an interface that i have here called
PaidHoliday
Data type returned: Double
and the parameters: CurrentYear

Do i have to use an example of this :

Function PaidHoliday (ByVal currentYear As Integer) As Double

But how to finish it???

Thank you
Hi. Here is an example;
Expand|Select|Wrap|Line Numbers
  1. Dim dblResult As Double
  2.  
  3. dblResult = PaidHoliday(2005) 'dblResult is 25.3
  4. dblResult = PaidHoliday(2002) 'dblResult is 22.6
  5.  
  6. Private Function PaidHoliday (ByVal currentYear As Integer) As Double
  7.    'do something here with currentYear eg
  8.    If currentYear = 2005 Then
  9.       PaidHoliday = 25.3
  10.    Else
  11.       PaidHoliday = 22.6
  12.    End If
  13. End Function
  14.  
Nov 15 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Michelle | last post by:
I have a div that is initially empty. Clicking on a button will add some text boxes and other controls so the user can add additional records. In IE all works fine but in Netscape 7.0 when I add...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
2
by: avivgur | last post by:
Hello, I am writing a program in Visual C# and I have encountered a problem. In my program I want to dynamically create a multitude of controls (thousands) on a form. The problem is that calling...
4
by: domas | last post by:
Hi, I can't get my semi-dynamic form to work. Maybe you could help. I've got a simple form with a select box. And a button that, when clicked, creates another copy if the select box and places...
47
by: Albert | last post by:
So structures are useful to group variables, so you can to refer to a collection as a single entity. Wouldn't it be useful to also have the ability to collect variable and functions? Ask K&R...
3
by: Fao, Sean | last post by:
I have a DataGrid that I'm adding CheckBox controls to at runtime (in the code behind) and I'm not sure if I'm doing it correctly. First of all, I noticed that the MyDataGrid.Columns.Add() method...
2
by: VolkerS | last post by:
Hallo, I need helping adding an existing Interface to an object I dispatched from a COM-server via win32com in Python. The Code for this in VisualBasic looks like that: Private Obj_1 As...
12
by: Bob Jones | last post by:
I have an odd business requirement and I think that the implementation is not correct in the terms of OOP development. Any help on the concepts would be very appreciated! We currently have a...
7
by: Rotsey | last post by:
Hi, I have a interface that I use for a form so I can pass the form to another object. How do I add the Paint event to the interface and subsequently handle the paint event in my other...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.