>I am running an exe - which runs another form, from one form I want to wait until the 2nd form is closed and then run some more code. is there any way to do that? Until now I ran the code from the second form. but I dont want to do that I want it to be run from the first form - since its a class and I need that code in several places.
>Is there any way to return a value from an exe?
>Shevy
An exe will return the value returned by the program which is designated as the main program in the project from which it was built.
Here's an example:
* Program....: Main.prg
* Version....: 1.0
* Author.....: Jim Fisher
* Date.......: September 5, 2001
* Notice.....: Copyright (c) 2001 Verizon Network Integration Corp., All Rights Reserved.
* Compiler...: Visual FoxPro 06.00.8961.00 for Windows
* Abstract...:
* Changes....:
#INCLUDE GPReport.h
LPARAMETERS tsDatabaseToUse
LOCAL ;
lbApplicationRan
STORE .F. TO ;
lbApplicationRan
*-- set up a simple error dump
ON ERROR DO WriteError WITH _VFP, ERROR(), PROGRAM(), LINENO(), MESSAGE(), SYS(2015), MESSAGE(1)
IF NOT IsValidString(tsDatabaseToUse)
tsDatabaseToUse = GPREPORT_DEFAULT_DATABASE
ENDIF && NOT IsValidString(tsDatabaseToUse)
IF NOT DBUSED(tsDatabaseToUse)
OPEN DATABASE (tsDatabaseToUse) SHARED
ENDIF && NOT DBUSED(tsDatabaseToUse)
IF DBUSED(tsDatabaseToUse)
SET DATABASE TO (tsDatabaseToUse)
*-- manage the help file
IF FILE(GPREPORT_HELP_FILE)
SET HELP ON
SET HELP TO GPREPORT_HELP_FILE
ELSE
SET HELP OFF
ENDIF && FILE(GPREPORT_HELP_FILE)
*-- keep the active-x controls happy
SYS(2333, 0)
_VFP.AutoYield = .F.
IF _SCREEN.NewObject([oApplication], [GPReportApp], [GPReport])
_SCREEN.oApplication.ShowInterface(tsDatabaseToUse)
lbApplicationRan = .T.
ENDIF && _SCREEN.NewObject([oApplication], [GPReportApp], [GPReport], [GPReport.exe])
*-- in case we're in development mode
IF NOT [LIB] $ UPPER(VERSION(1))
ON ERROR
ON SHUTDOWN
SET HELP TO
ENDIF && NOT [LIB] $ UPPER(VERSION(1))
ENDIF && DBUSED(tsDatabaseToUse)
RETURN lbApplicationRan
Hope this helps.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only