Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function vs Procedure
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00671285
Message ID:
00675117
Views:
15
Jim
What is the difference in behavior: Is it a fuction has to return to caller while a procedure can thread-on-out with out returning?
Terry

>Sony,
>
>It is the way you call the code that makes it behave one way or the other, not the way you declare it.
>
>
>FUNCTION Junk
>lcVar = "Hello"
>RETURN lcVar
>ENDFUNC
>
>PROCEDURE Junk
>lcVar = "Hello"
>RETURN lcVar
>ENDPROC
>
>
>The preceeding are exactly the same ion the way they will behave when called. If you call them with DO ... then they act like procedures and if you call them with Junk() they behave like functions.
>
>JimB
>
>>Functions and procedures are similar except in that a procedure does a job and returns and function does the job and returns a value(in theory). However, now they are used interchangeably.
>>
>>
>>Thanks
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform