Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I exit my program?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00390511
Message ID:
00390561
Views:
8
>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

Use RETURN .F. instead of Thisform.Release() so that it will not continue to instantiate.

Why don't you try to add object class in your _screen object to do what you ought to do instead of using a form.
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform