forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


ReturnCode

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
X-Tools
Valued Contributor
Valued Contributor


Joined: 20 Sep 2001
Posts: 296
Location: Germany

PostPosted: Thu Nov 21, 2002 10:53 am    Post subject: ReturnCode Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Nov 21, 2002 11:23 am    Post subject: Reply with quote

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. Wink

You can also pass and accept command parameters
with VDS...

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Nov 21, 2002 3:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
X-Tools
Valued Contributor
Valued Contributor


Joined: 20 Sep 2001
Posts: 296
Location: Germany

PostPosted: Thu Nov 21, 2002 3:16 pm    Post subject: vdsmem Reply with quote

Hi,

yes - I already did this some hours ago.
Its a good way to do it.

Thanks,

Bye, Fabian
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Thu Nov 21, 2002 6:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Nov 21, 2002 10:27 pm    Post subject: Reply with quote

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 Wink

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group