home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rxhll.zip
/
IBMLINK.REX
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-10-25
|
4KB
|
148 lines
/* #include <ibmlink.rex> */
HostEnterIBMLinkInfo: procedure expose Host.
/**
*** This will enter the account, userid, password and service (IBMLINK)
*** to connect to the IBMLink main menu
***
*** On Entry: CL/Menu
*** On Exit: IBMLink Main Menu
**/
code = HostWaitFor(60, 'SVM0201P')
if code = -1 then
call HostError
code = hllapi('Sendkey', '@0'Host.Account'@T'Host.Userid)
if (length(Host.Userid) < 7) then
code = hllapi('Sendkey', '@T')
code = hllapi('Sendkey', Host.Password)
if (length(Host.Password) < 8) then
code = hllapi('Sendkey', '@T')
code = hllapi('Sendkey', 'IBMLink@E')
code = HostWaitFor(180, 'MAINMENU')
if code = -1 then
call HostError
call HostIBMLinkNotify
return
HostIBMLinkNotify: procedure expose Host.
/**
*** This will display the notification messages at the bottom right
*** of the IBMLink main menu.
**/
call HostScreenToStem
FoundRow = 0
do i = 1 to (Screen.Rows - 2) while FoundRow = 0
if pos("___________________", Screen.i) > 0 then
FoundRow = i
end /* row loop */
if FoundRow > 0 then
do
code = Open(Host.News, 'Append')
call lineout Host.News, copies('═', 79)
call lineout Host.News, date()'...'
do i = (FoundRow + 1) to (Screen.Rows - 2)
parse var Screen.i . '|' NewsItem
call lineout Host.News, NewsItem
end /* do */
call lineout Host.News, copies('═', 79)
code = Close(Host.News)
end /* if */
return
HostIBMLinkLogon: procedure expose Host.
/**
*** This will log the use on to the host.
**/
call HostLogonClMenu
if Host.Logmode = '' then
Logmode = ''
else
Logmode = 'M('Host.Logmode')'
rc = hllapi('Sendkey', '/L' Host.Applid Host.Userid Logmode'@E')
rc = hllapi('Wait')
do while Host.Password = ''
say 'Enter the password for' Host.Applid '['Host.Application']'
Host.Password = GetNoEcho()
end
say "Logging on."
call HostEnterIBMLinkInfo
return
HostIBMLinkLogoff: procedure expose Host.
/**
*** This will log off from the host assuming that the first valid
*** entry field will support a logoff command. This does no error
*** checking or screen validation.
**/
say "Logging off."
rc = hllapi('Sendkey', 'LOGOFF@E')
rc = hllapi('Wait')
/* See if we have to 'release' the application */
code = HostWaitFor(30, 'SVM0201P')
if code = 0 then
rc = hllapi('Sendkey', '@T@T@TRELEASE@E')
return
HostIBMLinkETRDownload: procedure expose Host. Entry.
/**
*** This will download an IBMLink ETR entry into an internal
*** buffer and pass it to the caller
**/
call HostScreenToStem
parse var Screen.2 'Page' PanelCurrent 'of' PanelMax
/* Make sure we have valid numbers in the panel count */
if datatype(PanelCurrent, 'N') <> 1 then
do
call HapiError
return
end
if datatype(PanelMax, 'N') <> 1 then
do
call HapiError
return
end
Entry. = ''
j = 1
do Panels = PanelCurrent to PanelMax
FirstRow = 6
do Row = FirstRow to (Screen.Rows - 4)
Entry.j = strip(Screen.Row, 'Trailing')
j = j + 1
end
if Panels <> PanelMax then
do
call HostPageDown
end
end /* Panels */
Entry.0 = j
return