Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programatically find Return within WITH / ENDWITH
Message
From
24/06/2008 10:17:01
 
 
To
23/06/2008 17:58:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01326207
Message ID:
01326351
Views:
15
>However, WITH / ENDWITH is a little messier -- um, a lot messier -- since you need to find the matching ENDWITH for each WITH. Have not figured out how to do that. Once I can do so for a given PROC or METHOD, I should be able to do so for all of them as described in the thread.

should not be too difficult -- move the method/program into an array with ALINES(). Initialize a WITH counter to zero. Then loop through each array element (code line) and perform an ALLTRIM() to remove spaces and tabs. On each line, then do a case -- check for leading WITH (with a space), if found increment the WITH counter; if a ENDWITH is found, then decrement the WITH counter. If a RETURN is found and the with counter is greater than zero, then the RETURN is inside a WITH-ENDWITH construct.
Previous
Reply
Map
View

Click here to load this message in the networking platform