Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Advantage and disadvantage of funct PRG
Message
 
 
To
01/12/2017 16:21:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01656009
Message ID:
01656020
Views:
66
>>Hi,
>>
>>Say I have a function that I want to put into a separate PRG file. I can do it without declaring the FUNCTION FunctName within the PRG file. And then call this PRG name as a function. E.g.
>>
>>do MyPrgName with tParam1, tParam2
>>
>>
>>If I add a FUNCTION FuncName then I would have to do SET PROCEDURE to MyPrgMane ADDITIVE (somewhere at the top of the app) and then call it as
>>
>>FuncName( tParam1, tParam2)
>>
>>
>>What are the advantages or disadvantages of having the function inside a PRG without the FUNCTION declaration?
>
>Look up the order FP (/ VFP) is looking for a function. Back in the stone age just looking in the current .prg could give you speed benefits, but that difference on todays machines and if compiled into an app/exe is not a deciding factor.
>
>IMO Mikes position to always put each function in separate prg and trust the compiling step is not a easy to manage as several functions usually needed together for a similar topic (CSV list behaviour for instance) in a separate prg added wit set proc addi

Thank you. So far, the advantage (IMHO) in using the PRG without declaring the FUNCTION is that I don't have to SET PROCEDURE... Calling PRG should always work since it is in the .EXE. Since no one brought up any disadvantage(s) of using PRG without FUNCTION, I will go that route.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform