home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
haotd1_1.zip
/
DOWJONES.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-10-12
|
4KB
|
119 lines
/* This program dowjones.cmd, created by Hilgraeve and assigned to the */
/* Dow Jones phonebook entry runs an automated logon script for connecting */
/* to the Dow Jones service */
/* $Revision: 1.6 $ */
/* $Date: */
/* A REXX script MUST begin with a commented line */
/* Text within slashes and asterisks (like this line) are comments. */
/* Parse the command line for arguments passed to this program */
PARSE ARG pipename
/* Register external functions with REXX */
CALL RxFuncAdd 'haLoadFuncs', 'HA_AUTO', 'RxhaLoadFuncs'
CALL haLoadFuncs
/* Establish a link between this script program and HyperACCESS */
scripthandle = 0
scripthandle = haInitialize(1, pipename)
DROP pipename
/* Process only if link with HyperACCESS was successful */
IF scripthandle <> 0 THEN
DO
/* Initialize useful variables */
cr = '0D'x
lf = '0A'x
nul = '00'x
returnvalue = 0
if ReturnValue >= 0 THEN
ReturnValue = haSetLocalEcho(ScriptHandle, 1)
/* Type a '@' then <enter> */
if ReturnValue >= 0 THEN
ReturnValue = haTypeText(ScriptHandle, 0, "@")
/* Pause */
if ReturnValue >= 0 THEN
ReturnValue = haSleep(ScriptHandle, 1000)
/* Type a <enter> */
if ReturnValue >= 0 THEN
ReturnValue = haTypeText(ScriptHandle, 0, cr)
/* Turn local echo off */
if ReturnValue >= 0 THEN
ReturnValue = haSetLocalEcho(ScriptHandle, 0)
/* Wait for one of three prompts possible with Tymenet or Telenet */
if ReturnValue >= 0 THEN
ReturnValue = haWaitForPrompt(ScriptHandle, 3, "ERMINAL="nul"r name: "nul"identifier"nul, 300, 32000)
if ReturnValue == 0 THEN
/* If Telenet do this block */
DO
/* Type an <enter> */
ReturnValue = haTypeText(ScriptHandle, 0, cr)
/* Wait for a prompt */
if ReturnValue >= 0 THEN
ReturnValue = haWaitForPrompt(ScriptHandle, 1, "@", 300, 32000)
/* Type text to request Dow Jones */
if ReturnValue >= 0 THEN
ReturnValue = haTypeText(ScriptHandle, 0, "c dow"cr)
END
else
/* If Tymenet do this block */
DO
/* Type an 'a' */
ReturnValue = haTypeText(ScriptHandle, 0, "a")
/* Wait for a prompt */
if ReturnValue >= 0 THEN
ReturnValue = haWaitForPrompt(ScriptHandle, 1, "log in: ", 300, 32000)
/* Type text requesting Dow Jones */
if ReturnValue >= 0 THEN
ReturnValue = haTypeText(ScriptHandle, 0, "dow1;;")
END
/* Wait for a prompt */
if ReturnValue >= 0 THEN
ReturnValue = haWaitForPrompt(ScriptHandle, 1, "SE????"||cr||lf, 300, 32000)
/* Type text to request Dow Jones */
if ReturnValue >= 0 THEN
ReturnValue = haTypeText(ScriptHandle, 0, "djns"cr)
/* Pause */
if ReturnValue >= 0 THEN
ReturnValue = haSleep(ScriptHandle, 2000)
/* Get Password value from Runtime Values dialog box and add to logline */
if ReturnValue >= 0 THEN
DO
ReturnValue = haGetRuntimeValue(ScriptHandle, 3, 1, 128, 'PWord')
END
/* Get User ID value from Runtime Values dialog box and add to logline */
if ReturnValue >= 0 THEN
DO
ReturnValue = haGetRuntimeValue(ScriptHandle, 2, 1, 128, 'UserID');
END
/* Type the logline */
if ReturnValue >= 0 THEN
ReturnValue = haTypeText(ScriptHandle, 0, PWord||UserID)
/* Terminate link between HyperACCESS and script program */
CALL haTerminate scripthandle
END
DROP scripthandle
CALL haDropFuncs