#180583 - 2007-09-13 09:59 PM
Re: How do i get an error code from one Script to a Parent script
[Re: Les]
|
MarcInCa
Fresh Scripter
Registered: 2007-06-05
Posts: 22
Loc: Montreal, Canada
|
When you use Exit on the spawned script, pass a parm to it and that will be returned to the parent script. There is a FAQ on that.
Hoooo ! I see ! God I am learning a lot today.. (More coffee is brewing)
So if I call the child script with the SHELL command, the child script must have an EXIT command with the error code set. That way the parent Script will be able to use the value returned using @ERROR.
See example code below:
Parent Script: .... SHELL "WKIX32 Childscript.kix" IF (@ERROR = 0) Alll is well ELSE We got an error ENDIF
Childscript: ... IF $Test_successful EXIT 0 ELSE EXIT 99 ENDIF
Is this correct ?
Edited by MarcInCa (2007-09-13 10:00 PM)
_________________________
Treat people the way you want to be treated.
|
|
Top
|
|
|
|
#180586 - 2007-09-13 10:29 PM
Re: How do i get an error code from one Script to a Parent script
[Re: Mart]
|
MarcInCa
Fresh Scripter
Registered: 2007-06-05
Posts: 22
Loc: Montreal, Canada
|
Ho Dear ! You mean the SHELL call might not work and I should be using the call instead ?
OK guess i have to change some functionality for my main script but that wont be a big problem.
So the @ERROR value in the main script would not be set properly based on the SHELL call to another Kix script ?
Edited by MarcInCa (2007-09-13 10:37 PM)
_________________________
Treat people the way you want to be treated.
|
|
Top
|
|
|
|
#180591 - 2007-09-13 11:04 PM
Re: How do i get an error code from one Script to a Parent script
[Re: Mart]
|
MarcInCa
Fresh Scripter
Registered: 2007-06-05
Posts: 22
Loc: Montreal, Canada
|
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|