Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Duplicate Function
Message
From
16/12/2008 06:33:38
 
 
To
16/12/2008 06:27:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01367769
Message ID:
01367773
Views:
6
VFP does not support what's called "overloading", which means that you must give each function an unique name. If you have more than one function with the same name, the last loaded function will overwrite the earlier function in cache, and be used.


>Hi all
>I heard abaout 'You can do with vfp what ever you want!'.
>
>This means that you can include same function twice?
>
>Please look on the following code:
>
test1()
>function test1
>	a='First'
>	messagebox(a)
>endfunc
>function test1
>	a='Second'
>	messagebox(a)
>endfunc
> You will get messagebox 'Second'.
>
>You will get 'Second'. also if you will add 'Set procedure to .. additive.
>
>For Example
>
*prog1
>Set procedure to prog2  additive
>test1()
>function test1
>	a='First'
>	messagebox(a)
>endfunc
>function test1
>	a='Second'
>	messagebox(a)
>endfunc
>
>*prog2.prg
>function test1
>	a='Other'
>	messagebox(a)
>endfunc
>
>So, if vfp can do every thing, can I say to my dear fox to void duplicate function name?
>Help please
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform