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

On RETURN from a CALLED program how can I cause execution to continue? 4

Status
Not open for further replies.

JmichaelSR

Programmer
Mar 17, 2004
15
US
I have written a FOXPRO program which will select an Invoice from an Invoice Header File, build a key with which to access an Invoice Detail File, and call an Invoice Detail program passing the key as a parameter.

In the Invoice Detail program, I have coded an "EXIT" routine to send control back to the Header Program by issueing a "RETURN TO arhdrscr.scr" command. Return to the Header program is accomplished but control is returned to the BEGINNING of the routine that has ALREADY excuted and processing is HALTED. A Keyboard entry of some kind is required to continue.

How can I return to a point in the calling program just past the last command that was executed (the last command executed in the calling program was "DO invdscrn.spr WITH detrec)? Also, how can I cause processing to continue without a halt?

Any help anyone could offer would be greatly appreciated.

Thank You,


Mike Clark
Programmer/Analyst
Mississippi State Fire Academy
 
Mike,
How are you doing the "call" on the Invoice detail program? If it's just 'DO InDet with InvPK', then you should come back to the first program at the next statement with a simple RETURN in the second program.

Rick
 
Im a bit rusty but I believe instead of the exit use the return to return to the next statement in the calling program or the 1st program. Exit will end and go to the begining just like you described



 
Since it appears your calling program is a screen, make sure the screen is modal. Then when you call out to your 'Invoice Detail' program, and the 'Invoice Detail' program has finished processing, just have it return.

Processing should continue where the screen left off.


Darrell
 
Would it not be wise to use "Save screen to " and then
upon returning use "Restore screen from "

 
I think you are a little confused about the functionality of VFP. What you propose doing has nothing to do with insuring a program blocks the calling programs' execution.

If your code is structured the way I assumed, making the called form modal, is all you need to do.

Do you understand the concepts of modal and modeless forms?

Darrell
 
If you call a screen with the properties of Alert or User (basically anything but Desktop)from another screen then all you have to do is to terminate the read (such as with a button with this option checked, or by placing the phrase "CLEAR READ" as a command in a button or menu selection).

When the read is terminated the "new" screen will disappear and "old" screen will resume focus and the code will resume where it should - right after your command to run the new screen.

I hope this solution meets your needs.


B"H
Brak
 
Thanks to all who have given me help with my FoxPro problems. I still haven’t resolved my problem. I am sure it’s just a lack of my understanding of Windows FoxPro 2.5.

I've been a COBOL Mainframe programmer for many years but know very little about FoxPro and Data Base programming. I am trying to learn FoxPro on my own and the educational resources I have access to are very limited.

Darrell, you are correct. I am confused about the functionality of VFP and do not understand the concepts of modal and modeless forms. After receiving your first response, I tried to find help on how to make a screen "modal" and found very little. The only thing I found was the use of "MODAL" in the "READ" command. I changed my Read command from "READ CYCLE" to "READ CYCLE MODAL" and still had the same problems.

Does anyone have any suggestions on reading material or online sites that would help with my education process?

Thanks,

Mike Clark



Mike Clark
Programmer/Analyst
Mississippi State Fire Academy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top