Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return statements within the with endwith blocks
Message
From
07/01/2017 09:47:02
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
06/01/2017 16:56:00
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01646361
Message ID:
01646385
Views:
59
>>>Thanks, Tore. Perhaps this may be one of the problems here, which we may want to eliminate. Although it's a bit tricky given that lengthy code.
>>
>>I hope you use Thor? One of the Thor tools will give you a list of the places where you have a Return within a With-Endwith construct. It can even fix it for you.
>
>"Fix it for you"? Since multiple RETURNs is one sign of spaghetti logic, how can Thor "fix" it in the general case?

I guess it would create a local variable, set it to .t., then wrap the rest of the with-endwith block in if ThisLocalVar...endif, then the rest of the code in the procedure in another such if-endif block... and so on until out of any if, scan, for and other blocks/loops, so the code swims out executing nothing else.

If there's spaghetti in there before this is done, it would now also have sticky stringy cheese too.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform