Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Argument starter - The roots of all evil
Message
From
02/09/2004 08:14:02
Walter Meester
HoogkarspelNetherlands
 
 
To
02/09/2004 07:12:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00938079
Message ID:
00938701
Views:
20
Fabio,

>Another example:
>
>DO WHILE <condition1>
>	<a long sequence1 of commands>
>	IF <condition2>
>		EXIT
>	ENDIF
>	<a long sequence2 of commands>
>ENDDO
>
>* implement this into VFP
>
lContinue = <Condition1>
DO WHILE lContinue
    <a long sequence1 of commands>
    
    lContinue = !<Condition2>
    IF lContinue
       <a long sequence2 of commands>

       lContinue = <Condition1>
    ENDIF
ENDDO
>
>DO WHILE <condition1>
>	<a long sequence1 of commands>
>	DO WHILE <condition2>
>		<a long sequence2 of commands>
>		IF <condition3>
>			LOOP 1
>		ENDIF
>		<a long sequence3 of commands>		
>	ENDDO
>	<a long sequence4 of commands>
>ENDDO && LOOP 1 go here
DO WHILE <condition1>
	<a long sequence1 of commands>
	DO WHILE <condition2>
		<a long sequence2 of commands>
	       	IF !<condition3>
			<a long sequence3 of commands>  && Asuming <Condition3> does not change here
		ENDIF
	ENDDO
	IF !<condition3>
		<a long sequence4 of commands>
	ENDIF
ENDDO
This is how you should do it when still using the old JSP tactics, however if the Long sequences are put into a function or reordered it can be way more efficient (and of course readable).

It all of course depends on how the conditions are build up, whether they are still valid when evaluated on another place, if not you you'd probably end up with using variables. The problem goes beyond the very abstract of you example: it has also to do with what the total algorithm has to do and if it can be restructured in another form.

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform