Article ID: 196236
Article Last Modified on 3/7/2005
LOCAL ln_OpenMainPrg, la_Version[1]
*- Create a "Main.prg" programmatically.
IF FILE("Main.prg")
ln_OpenMainPrg = FOPEN("Main.prg", 12)
ELSE
ln_OpenMainPrg = FCREATE("Main.prg")
ENDIF
IF ln_OpenMainPrg < 0 && Check for error
WAIT WINDOW NOWAIT "Cannot open or create output file"
ELSE && If no error, write to file
=FWRITE(ln_OpenMainPrg, "? 'Hello, World!'")
ENDIF
=FCLOSE(ln_OpenMainPrg) && Close file
*- Create project and build the .exe programmatically.
CREATE PROJECT Test NOWAIT NOSHOW
MODIFY PROJECT Test NOWAIT
Application.ActiveProject.Files.Add("Main.prg")
BUILD EXE Test FROM Test
Keywords: kbbug kbfix kbappsetup kbwizard kbvs600sp3fix KB196236