| View previous topic :: View next topic |
| Author |
Message |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Thu Nov 21, 2002 10:53 am Post subject: ReturnCode |
|
|
Hi,
is it possible to let a vds script produce a returncode
which i can read on another script using @RETCODE() ?
Bye, Fabian |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Nov 21, 2002 11:23 am Post subject: |
|
|
I don't think so. The @retcode() function reads the
exit code from a program that's written into the code,
such as "return 0;" in C/C++. VDS doesn't have a
function or command to set an exit code that I know
of. I've not found @retcode() to be very dependable
anyway...
You can save a value to a file or registry key (or even
the clipboard, but that's kinda risky) and read it from
another VDS program though.
You can also pass and accept command parameters
with VDS...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Nov 21, 2002 3:11 pm Post subject: |
|
|
You could also have a look at the VDSMEM.DLL - it lets you share variables between different
VDS programs. So you can have one program set a variable that can be read and used by another
program.
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Thu Nov 21, 2002 3:16 pm Post subject: vdsmem |
|
|
Hi,
yes - I already did this some hours ago.
Its a good way to do it.
Thanks,
Bye, Fabian |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Thu Nov 21, 2002 6:18 pm Post subject: |
|
|
If you would really want to set the DOS errorlevel from your VDS script, you can terminate
them using the VDSEXIT DLL contained in the VDSDLL 3. |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Nov 21, 2002 10:27 pm Post subject: |
|
|
Hi All,
Or you can do it with the GadgetX.dll like so
| Code: |
Title Set Exit code
Rem This example shows how you can use gadget to call ExitProcess
rem from kernel32.dll to return an exit code
rem for your programs.
rem
rem First compile this code in VDS to an exe
rem Then run another script to call the exe that you just compiled
rem Use something like this in the calling script
rem RUN SetExitCode.EXE,wait
rem info Return code was @retcode()
rem
External GadgetX.dll,5.0
#DEFINE COMMAND,DEFINE,FREEDLL,SET,CALL
#DEFINE FUNCTION,LOADDLL,GET,CALL
Define Variable,HANDLE,kernel32
Set kernel32,@LoadDll(kernel32.dll)
Define Function,,NULL,kernel32,ExitProcess,ExitProcess,Long|uExitCode
DIALOG CREATE,Set Exit Code,-1,0,222,172
DIALOG ADD,RADIO,RADIO1,30,72,80,90,Exit Code,0|1|2|256,Value 0
DIALOG ADD,TEXT,TEXT1,12,24,172,13,Choose an exit code for this program
DIALOG ADD,BUTTON,CLOSE,136,78,64,24,&CLOSE
DIALOG SHOW
:evloop
wait event
%E = @event()
if %E
goto %E
End
goto evloop
:CLOSEBUTTON
:CLOSE
Call ExitProcess,@dlgtext(RADIO1)
Exit
|
Anyway isn't it nice to have options  _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|