home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 40,578 of 42,547   
   Graham Hobbs to All   
   getting a CMD retcode back to a REXX   
   19 Nov 12 21:45:59   
   
   From: ghobbs@cdpwise.net   
      
   Uli, Jeremy,   
   didn't work, am cross posting to alt.msdos.batch   
      
   My ooRexx atest.rex calls Windows XP youtry.cmd. The cmd may fail and   
   I need to return a 'code' to the rexx. Am not having success.   
      
   This is my rexx that runs youtry4:   
   /* rexx */   
   'youtry4'   
   say 'rc='rc   
   exit   
      
   This is my youtry4.cmd:   
   @echo off   
   echo am in youtry4   
   set  errorflag=0   
   echo %errorflag%   
   rem  do stuff maybe reset errorflag e.g:   
   set  errorflag=4   
   echo %errorflag%   
   if   %errorflag% GTR 0 EXIT /B 7   
   echo leaving youtry4   
      
   .. when rexx was run results were:   
   C:\Analysis>atest.rex   
   am in youtry4   
   0   
   4   
   rc=0   
   C:\Analysis>   
      
   .. suggesting that EXIT /B 7 forces the exit but doesn't return a 7 in   
   rc   
      
   Please, thanks   
   Graham Hobbs   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca