home *** CD-ROM | disk | FTP | other *** search
- /* Sample Script*/
- /* This script will allow you to log on to Compu-Plane once you change */
- /* the strings stored in the varibles name and pass. Enter the sample.scr */
- /* name for the script name of the Compu-Plane phone number, and change */
- /* the name in the shell() function to the path and filename of this file.*/
-
- Call RxFuncadd "init_dll","RxPmcomm","init_dll"
-
- /* This function registers the init_dll function with REXX. The init_dll*/
- /* function will register the rest of the functions in the rxpmcomm.dll. */
-
- Parse arg port portname screen_handle dde_output dde_input semaphore
-
- /*These are the values that Pmcomm passes on the command line to and */
- /* external program. These values can then be used in different REXX */
- /* functions along with the rxpmcomm.dll functions. Following is the */
- /* description of each value: */
- /* port = The handle of the open com port in Pmcomm */
- /* portname = The name of the opened com port ie.. COM1 */
- /* screen_handle = Anything written to the handle will be printed */
- /* on the Pmcomm screen. */
- /* dde_output = This must be passed to any file transfer function. It*/
- /* allows the rxpmcomm.dll function to communicate with */
- /* Pmcomm. */
- /* dde_input = This must be passed to any file transfer function. It*/
- /* allows the rxpmcomm.dll function to communicate with */
- /* Pmcomm. */
-
- Call init_dll
-
- /* Required before any other rxpmcomm.dll functions are called. */
-
- /* Setup variables */
- name = 'first;name' /* where first is your first name and last is*/
- pass = 'password' /* your last name and password is you password.*/
- cr = '0d'x
-
- Call read_timeout '20000',port
-
- /* This sets the read timeout for 20 seconds. This is used in the */
- /* wait_for, wait_fore, and the Get_ch functions. */
-
- Say 'Waiting for first name ...'
-
- /* This will be printed on the REXX screen. */
-
- Do Forever
- Call Wait_fore 'name','password','continue?',' ? ','[N]o, [C]',port,screen_handle
-
- /* This call will echo all characters to the Pmcomm screen that come */
- /* from the open com port. When one of the strings are matched the */
- /* function will return the index of the matched string in the variable */
- /* result. For example if it receives the string password then result */
- /* will be equal to 2. If the functions waits longer then the read timeout */
- /* value then result will be equal to 0. */
-
- match = result
- Select
- When match=1 then
- Do
- Call Put_s name||cr,port
- Say 'Waiting for password ...'
- End
- When match=2 then Call Put_s pass||cr,port
- When match=3 then Call Put_s cr,port
- When match=4 then Exit
- When match=5 then Call Put_s 'n',port
- Otherwise nop
- End
- End
- Say 'Script ended -' date() time()
- Exit
-