Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do you think command window is not powerful enough!?
Message
 
 
To
18/09/1998 21:20:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00138559
Message ID:
00140057
Views:
29
Actually you can do this in the command window in VFP 5.

Cut and paste the code below into the command window, highlight all of the code, and then press Enter, or right-click and choose Execute Selection.

>You can't work For-loop, While-loop, Scan..EndScan with simple work in command window.
>
>So, everytime you need to write a prg and run it...
>but actually, we can do it as one-line like Prolog!!
>
>Of cos, you can also to build a general form to do your work... ^_^
>and u will expand less time to recompile all on try!
>
>

>Following is a One-line For-Loop call!
>
>**	FOR LOOP
>PROCEDURE FL	&& make one line simple For-Loop
>LPARAMETERS nStart, nEnd, cAction, cExit, cLoop
>
>DO CASE
>CASE PCOUNT() = 3
>	FOR ix = nStart TO nEnd
>		&cAction
>	ENDFOR
>
>CASE PCOUNT() = 4
>	FOR ix = nStart TO nEnd
>		&cAction
>		IF (&cExit)
>			EXIT
>		ENDIF
>	ENDFOR
>
>CASE PCOUNT() = 5
>	IF !EMPTY(cExit)
>		FOR ix = nStart TO nEnd
>			&cAction
>			IF (&cExit)
>				EXIT
>			ENDIF
>			IF (&cLoop)
>				LOOP
>			ENDIF
>		ENDFOR
>	ELSE
>		FOR ix = nStart TO nEnd
>			&cAction
>			IF (&cLoop)
>				LOOP
>			ENDIF
>		ENDFOR
>	ENDIF
>ENDCASE
>ENDPROC
>
>
Rick Hodder
MCP Visual Foxpro
C#, VB.NET Developer
Independent Consultant
www.RickHodder.com
MyBlog
Previous
Reply
Map
View

Click here to load this message in the networking platform