I am trying to write a simple sign-in script but cant seem to figure out why it wont go to the next command sequence. Here is my script:
-----------------------------------------------------------------------------------
Enter = '@E'
Tab = '@T'
On = 1
Off = 0
GetScrn = 'Copy_PS_to_Str'
PutScrn = 'Copy_Str_to_PS'
TRACE E
'@cls'
/*************************************************************/
/** Load the hllapi program **/
/*************************************************************/
if Rxfuncquery('hllapi') Then
call Rxfuncadd 'HLLAPI','SAAHLAPI','HLLAPISRV'
/*************************************************************/
/** connect to retain.ws to sign in **/
/*************************************************************/
RC=HLLAPI( 'Connect', A )
/*************************************************************/
/** confirm screen and get to signin screen **/
/*************************************************************/
IF 'IBM' = HLLAPI(GetScrn,107,3) THEN
DO
RC=HLLAPI('SENDKEY','Rta')
RC=HLLAPI('wait')
RC=HLLAPI('SENDKEY',ENTER)
RC=HLLAPI('wait')
END
ELSE
NOP
/*************************************************************/
/** Verify signon screen and signin **/
/*************************************************************/
ExitOK = Off <----- It stops at this point. at this screen it just doesnt continue.
DO L = 1 TO 5 UNTIL ExitOK = On
IF 'USER' = HLLAPI(GetScrn,731,3) THEN
ExitOK = On
ELSE
NOP
END
IF ExitOK = On THEN
DO
RC=HLLAPI('SENDKEY','userID/Pswd')
RC=HLLAPI('wait')
RC=HLLAPI('SENDKEY',ENTER)
RC=HLLAPI('wait')
END
ELSE
NOP
-------------------------------------------------------------------------------------------------------
If I string all the command together in one long DO command it works. But i dont want that. I want to verify each screen. Any advice would be much appreciated.