Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 8 Jahren, 1 Monat
Letzter Beitrag:
vor 8 Jahren, 1 Monat
Beteiligte Autoren:
PETER ZHOU, jem, Alexandre Leclerc, Malc

WINDEV's ENDPROGRAM

Startbeitrag von PETER ZHOU am 02.06.2010 07:57

Hi,

Program A -> "runs/calls" ->Program B(WINDEV)

How can WINDEV return a error code or any code ?

ENDPROGRAM in windev doesn't return code.

Regards,

PETER ZHOU

Antworten:

Hi Peter

Under ExeRun in the help:



Return value of a WinDev executable



A WinDev executable can return a value. To do so:

1. Create an Integer variable global to the project.

2. Initialize this variable with the value to return.

3. Return this variable with RESULT in the closing code of the project.




Cheers

Malc

von Malc - am 02.06.2010 11:50
look in the help for "return value of a windev executable"

for endprogram to return value you must specify the flag to run closing code
ex:

endprogram("program terminate", true)




von jem - am 02.06.2010 16:45
Quote
jem
look in the help for "return value of a windev executable"

for endprogram to return value you must specify the flag to run closing code
ex:

endprogram("program terminate", true)



Hi,

It's not working for both the RESULT ( at closing code of project ) and ENDPROGRAM with flag.

Is there any other solution ?

Regards,

PETER ZHOU

von PETER ZHOU - am 03.06.2010 12:29
I don't understand. you try this test. create 2 project

project 1 with one window as first project window and add 1 button
at project code - initialization
GLO_retval is int = 1

at project code - initialization
result glo_retval

at the click btn_button1 event
glo_retval = 999
endprogram("program terminate", true)

generate / compile . copy the exe to project 2 exe folder

------------------------------------------------------------------------------------
project 2 with one window as first project window and add 1 button

at the click btn_button1 event
info(exerun("project1.exe", exeactive ,exeruturnvalue))


then run project2 . when you click on the button , project2 will run
if you close project2 , it should return 1
if you click on button on project2, it should return 999

if it doesn't work , sorry can't help you already. I have no idea

von jem - am 03.06.2010 21:18
Hi jem,

I made a quick test returning the value of a spin edit and this works as expected (WD14).

- You need a global integer variable in the project code initialisation.
- You must add RESULT GLO_retval in the project closing event.

Asside that your code looks good: EndProgram has good params, you set the global value before closing, and ExeRun() call is ok.

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 04.06.2010 12:49
Hi,

Program A ( not windev) -> calls/run -> Program B (Windev )

ENDPROGRAM seems to work when both program is compiled in windev...but not working for the calling program compiled in another lanuage.

Regards,

PETER ZHOU



von PETER ZHOU - am 07.06.2010 03:21
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.