Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keep users in Application - No Access to Command Window

Status
Not open for further replies.

StorageLady

Programmer
Nov 27, 2001
14
0
0
US
Using FPW2.6A on Windows 2000 network

Is there a simple way to ensure users can't get to the command window?

I have a menu driven program. When an error occurs, and the user hits cancel - they get taken to the command window.

Any way to prevent that?

Can't find the manuals that came w/FoxPro, so I'll ask a probably very simple question:

How can I have the users go directly to the menu program when the double-click on the FoxPro icon? That is, I want them to go immediately to c:\program\runthis.prg

Thanks!
 
2 potential solutions for you

1. Compile your program to an EXE file if you have the developer edition of Foxpro.

2. If using Foxpro for DOS. Assume your Foxpro directory is c:\fox26. Set up an Icon on your desktop as follows:
From Explorer find the file FOXR.exe in your Foxpro directory. Right Mouse drag it to the desktop and select 'Create Shortcut'
Right mouse click the shortcut and select 'Properties'

Under the Program tab, extend the information already in the cmd line box by adding -t c:\program\runthis.prg
.Your command line should look like c:\fox26\foxr.exe -t c:\program\runthis.prg

Make sure your working directory is your normal foxpro directory c:\fox26 or whatever directory you specify. Do not leave blank or your desktop will fill up with .TMP files.

Click the 'Close on Exit' box.

If you do this, the program will quit where previously users were being returned into the command window, or worse still into the code editor. Also the program will launch directly to your menu from the desktop icon.
 
On the first question:
Use an on error routine:

Somewhere in the start of your application:
on error do myprog with error() && if you want to do some error checking...
In this myprog you can do anything you want e.g. quit foxpro etc.

On the second question:
One way of doing that is to write in the config.fpw file do otherprog where otherprog is the name of the routine you want to start.

Another way is to add the name of the prog as parameter to the fastlink on the desktop.

Rob.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top