Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with FOR .. ENDFOR
Message
From
25/07/2000 17:43:09
 
 
To
25/07/2000 17:31:21
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00396797
Message ID:
00396802
Views:
10
By design.
In VFP, if a variable is created but not declared, its scope is PRIVATE, which means that any program called from where the PRIVATE variable is created can see and modify this PRIVATE variable.
In each of your procedures, declare i LOCAL, like this
PROCEDURE parent_loop
<b>LOCAL i</b>
for i=1 to aval
stuff
=my_funct()
endfor

PROCEDURE my_funct
<b>LOCAL i</b>
for i=1 to anotherval
do stuff
endfor
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform