Article ID: 156342
Article Last Modified on 12/1/2003
DO .\<progname>
* Start of code example
*
LOCAL lcCurDir, lnI
lcCurDir=SET('default')+CURDIR() && Save the current directory
CLEAR
MD c:\testxx && Make the new directory
FOR lnI = 1 TO 2
MD 'c:\testxx\t'+ALLTRIM(STR(lnI)) && Make one of the subdirs
CD 'c:\testxx\t'+ALLTRIM(STR(lnI)) && Change to it
* Put the program code into the clipboard
_CLIPTEXT = '? " This is in My_Prog from T'+ALLTRIM(STR(lnI))+'"'
KEYBOARD '{ctrl + v}' && This will paste it into the program
KEYBOARD '{ctrl + w}' && This will close the editor
MODIFY COMMAND My_Prog && Open the editor - then the above 2
&& keystrokes will be processed
DO My_Prog && Run the program
ENDFOR
FOR lnI = 1 TO 2
CD 'c:\testxx\t'+ALLTRIM(STR(lnI)) && Change to one of the subirs
DELETE FILE My_Prog.FXP && Delete the .PRG/.FXP file
DELETE FILE My_Prog.PRG
CD ..
RD 'c:\testxx\t'+ALLTRIM(STR(lnI)) && Remove the subdir
ENDFOR
CD (lcCurDir) && Switch to the original default
RD c:\testxx && Remove the directory
*
* End of code example
Both messages printed to the FoxPro desktop refer to the T1 directory.
CLEAR PROGRAM
DO My_Prog
DO .\My_Prog
Additional query words: kbdse VFoxWin
Keywords: KB156342