VFP - Do <proc> with ...
Posted: Fri Oct 25, 2019 5:47 pm
Guys,
a questions to the VFP community. It´s about what the VFP SP2 helpfile says about "Parameters in Procedures and Functions"
ok, so far there´s no problem, but here it comes
Honestly, even in my wildest (xbase) dreams i never made it to dream about such an option Does this really work as described ?
regards
Karl-Heinz
a questions to the VFP community. It´s about what the VFP SP2 helpfile says about "Parameters in Procedures and Functions"
Code: Select all
myVar = 4
myVar2 = 5
DO myProcedure WITH myVar, myVar2
By default, variables and arrays pass to procedures by reference. Therefore, changes made in the procedure to passed variables and arrays are passed back to the calling program. For example, suppose the procedure increments the value in myVar by the value in myVar2. The modified value of myVar becomes the
new value of myVar when the procedure returns control to the calling program.+
Code: Select all
Alternatively, if you want to use the DO command but want to pass data by value, enclose each parameter with parentheses (()) as shown in the following
example:
DO myProcedure WITH (myVar), (myVar2)
regards
Karl-Heinz