Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When to use parenthases after commands?
Message
From
15/08/2006 18:58:29
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01145740
Message ID:
01145836
Views:
16
>I'm still in the dark about when to use parenthases after commands such as thisform.refresh or thisform.refresh() and this.interactivechange or this.interactivechange(). Can someone explain when you do and don't use the parenthases or why you would or wouldn't?
>Thanks!

On VFP syntax, an property have priority respect to a method/procedure.

You do the parenthases when you put a parameter or you want evaluate the RETURN value,
otherwise you can don't use the parenthases for a speed up execution ( also of 3 times ),
because without parenthases and evaluation of return value VFP skip to search in properties list.

For a PRG's procedure VFP require parenthases ( this is a little parser bug ),
and then it search in array variable list before to search in procedure list.
with a "DO procedure" you skip this search and the execution is faster
CLEAR

? xx[2]

DIMENSION xx[2]
xx[2]="array 2"

? xx[2]
* deterministic and faster syntax
DO xx WITH 2

PROCEDURE xx(z)
	? "proc",z
This open the same issue of the "m" dot prefix,
because you can hide a procedure with a homonym array.
Previous
Reply
Map
View

Click here to load this message in the networking platform