467,114 Members | 1,202 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,114 developers. It's quick & easy.

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
  • viewed: 986
Share:
2 Replies
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
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

Post your reply

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

Similar topics

9 posts views Thread by Michelle | last post: by
2 posts views Thread by laredotornado@zipmail.com | last post: by
2 posts views Thread by avivgur | last post: by
3 posts views Thread by Fao, Sean | last post: by
7 posts views Thread by Rotsey | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.