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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Building an exe application

Status
Not open for further replies.

Jackhag

Programmer
Mar 5, 2003
6
US
I am a newbie trying to build a simple exe application. My main.prg says the following:
do sadinq && SAD program
read events
clear events
close all
quit

After I build and exe file and run it from the start button, I get the following message:

"Allowed do nesting level exceeded"

I have run the sadinq program withing Foxpro 6.0 without any problems. It accesses one table and shows data on a screen.

Thanks in advance
 
Hi

You have not provided the complete code..
You are using a

DO WHILE .... whatever...
DO something
LOOP
** SO the LOOP again calls DO something.. etc..
** If you remove the DO WHILE loop your error could go.

ENDDO

In concept... you are not existing the loop properly and calling the same prg or form to be run several times from within a loop.. and that is creating the trouble. :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
I have no do while. The complete code for main.prg is above. The SADINQ.prg program runs stand alone in Foxpro 6.0 with no problems.

Jack H.
 
Hi,
There must be some issue in your sadinq program, what is the program supposed to be doing,

Aiden
 
Hi Jackhag,

I think what you are doing here is running your code in a program called Sadinq.Prg, which itself contains the command DO Saninq. Is that right? If so, it would explain the error message you saw.

Another thing you might try is to remove the READ EVENTS and CLEAR EVENTS. If you are not calling a form or a menu, those commands are useless.

If none of that works, then the problem must lie within Sadinq itself.

Mike
Mike Lewis
Edinburgh, Scotland
 
I removed the read events and clear events. I put as my first command in the called program (SADINQ.prg) - set step on

It never got to that message. It is giving me the nesting error before actually going into the called program.

I repeat. I have no do loop or any other loop in the called program. The code is as follows:

do sadinq
close all
quit

The project is called sadinq. It has in it 2 tables, the calling program called "MAIN.prg" and the called program called "SADINQ.prg". To create the application and executable files, I click on the build button and the radio buttons "build application" and after that's done running I do the same with the radio button "build executable". Am I missing something?

Jack H.
 
Let me make sure I've got this right. The first line of Main.Prg calls Sadinq.Prg. The first line of Sadinq.prg is SET STEP ON. When you run Main, you do not see the SET STEP ON.

If that's right, the only explanation I can think of is that Main.PRG is not your main program, that is, it is not flagged as the main program in the project.

If you look at Main in the Code tab of the project manager, does it appear in bold print? If not, check to see which file in the project does appear in bold. It might be a PRG, a form or a menu. Whichever one it is, it probably contains the code which causes the nesting error.

To fix it, go back the Code tab, right-click on Main, and select Set as Main. The program should now appear in bold. Build and run the EXE, and see what happens.

Mike
Mike Lewis
Edinburgh, Scotland
 
I'll take another quick stab...
even though the code you posted is in a program called MAIN.PRG, are you creating an EXE file named: sadinq.exe?

then "DO sadinq" will launch the .EXE file again (only, since it recognizes it's a VFP .EXE, it doesn't reload VFP, it just re-executes the .PRG in the .EXE that is marked as being the "Main" program.
 
This last post was right on! I changed the name of the called program from sadinq to sadi. I intended to call sadinq.prg but instead called sadinq.exe which was my stand alone. After changing all the names, I now can't get it to do anything. It is in ram but won't and vfp is running but doesn't do anything. To review:
1. I have a prg called main which has these instructions
do sadinq
clear all
quit

2. I have a program called sadinq which inquires 2 tables upon entry to a window of a parcel number.

3. I have project, application and exe file all called sadi. I have a shortcut to sadi.exe which produces the above results. I built the app and exe file using the project build button.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top