Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trivial question re return value and ()
Message
From
18/05/2016 12:51:41
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
18/05/2016 10:41:27
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
Windows Server 2012
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01636581
Message ID:
01636590
Views:
68
>HI all,
>
>Trivial question: I have seen and used both of these at the end of procedures to return a value:
>
>(where lnReturn is a var)
>
>RETURN lnReturn
>
>RETURN ( lnReturn )
>
>Is there any real difference? Or when would the one with parenthesis be required?
>
>Albert

Some commands use name expressions when a name is required.

x=3
y=5
return (x * y) does the same as return x*y.

lcReturn = "x * y"
return (lcReturn) does not evaluate the expression.

What does make a difference is RETURN m.lcReturn. It's funny someone would add parentheses for no reason, but not use m. when there is a reason.
Previous
Reply
Map
View

Click here to load this message in the networking platform