Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
How do I exit my program?
I have a main.prg that has the following code:
*!* open database employee
on shutdown do myshutdown
_screen.windowstate=2
do form renamefile
read event
on shutdown
I have myshutdown.prg that contains the following code:
&& myshutdown
clos all
clea all
capslock(.f.)
clear events
quit
In my form (renamefile) init I am just renaming a file then trying to exit the program:
with thisform
local f,t,continue_on,sour,dest
continue_on = .t.
adir(a__gen2,'d:\test\qlblsrc.fr*')
if type('a__gen2') # 'U' and type('a__gen2') # 'L'
sour=a__gen2(1,1)
conv=stuff(sour,1,8,'')
conv=alltrim(conv)+'.txt'
dest='d:\test\'+conv
sour = 'd:\test\'+sour
rename (sour) to (dest)
endif
endwith
thisform.release()
clear event
return(.t.)
When I run this program in .exe the form renamefile doesn't seem disappear. I need a way to run my code without user intervention. I am doing this right. Can we just run prg file like a batch file? If so how do exit the program without user intervention.
Thanks
Help appreciated
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement