home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / ME494-1.ZIP / COMUTIL.SRC < prev    next >
Encoding:
Text File  |  1990-05-24  |  18.7 KB  |  645 lines

  1. $MACRO_FILE COMUTIL;
  2. {******************************************************************************
  3.                                                 MULTI-EDIT MACRO FILE COMUTIL
  4.  
  5. COM_MEFT_XFER - File transfer interface to the external program MEFT.
  6. COM_DSZ_XFER  - File transfer interface to the external program DSZ.
  7. COM_LOG_WBBS  - Auto log-on macro for WBBS.
  8. COM_LOG_COMPU - Auto log-on macro for Compuserve.
  9. COM_LOG_RBBS  - Auto log-on macro for most RBBS and PC-Board systems.
  10.  
  11.                              (C) Copyright 1990 by American Cybernetics, Inc.
  12. ******************************************************************************}
  13.  
  14. $MACRO COM_MEFT_XFER TRANS;
  15. {*******************************MULTI-EDIT MACRO*******************************
  16.  
  17. Name:    COM_MEFT_XFER
  18.  
  19. Description:    A comunications module macro.  Provides an interface to the
  20. external protocol program MEFT.EXE.
  21.  
  22. Parameters:
  23.                             /MY= The Y coordinate to reference screen output to.
  24.                             /DIR= The direction of the transfer.  Legal values are:
  25.                                     UP  -  for upload
  26.                                     DOWN  -  for download
  27.                             /FN= The file name.  Not needed if YMODEM batch.
  28.                             /BATCH= Only needed if /PRO=YMODEM and batch.  It is the name of
  29.                                             the file list for YMODEM batch uploading.
  30.                             /PRO= The protocol name.  Legal names are:
  31.                                     XMODEM
  32.                                     XMODEM-CRC
  33.                                     XMODEM-1K
  34.                                     YMODEM
  35.  
  36. Returns:
  37.                             Return_Int = 0 - Transfer was probably successful.
  38.                             Return_Int = -1 - Transfer was unsuccessful.
  39.  
  40.                              (C) Copyright 1990 by American Cybernetics, Inc.
  41. ******************************************************************************}
  42.     Def_Str(Direction[8],Tstr,Protocol[20],
  43.                         prot[4] );
  44.     Def_Int(Menu_Y,Error,Port_Num,jx);
  45.  
  46.     port_num := global_int('COM_PORT_NUM');
  47.     Menu_Y := Parse_Int('/MY=',MParm_Str);
  48.     IF (Menu_Y < 1) THEN
  49.         Menu_Y := 3;
  50.     END;
  51.     Direction := Parse_Str('/DIR=',MParm_Str);
  52.     Tstr := Parse_Str('/FN=',MParm_Str);
  53.     Protocol := Caps(Parse_Str('/PRO=',MParm_Str));
  54.     Error := XPos('(',Protocol,1);
  55.     IF (Error) THEN
  56.         Protocol := Copy(Protocol,1,Error - 1);
  57.     END;
  58.     IF protocol = 'XMODEM' THEN
  59.         prot := 'X';
  60.     ELSIF copy(protocol,1,10) = 'XMODEM-CRC' THEN
  61.         prot := 'XC';
  62.     ELSIF copy(protocol,1,9) = 'XMODEM-1K' THEN
  63.         prot := 'XC1K';
  64.     ELSIF copy(protocol,1,6) = 'YMODEM' THEN
  65.         prot := 'YC';
  66.         IF direction = 'UP' THEN
  67.             IF parse_str('/BATCH=', mparm_str) <> '' THEN
  68.                 tstr := '@' + parse_str('/BATCH=', mparm_str );
  69.             END;
  70.         END;
  71.     ELSE
  72. invalid_parameter:
  73.         RM('MEERROR^MessageBox /T=ERROR/B=2/M=Invalid protocol name for MEFT file transfer.');
  74.         goto exit;
  75.     END;
  76.     Put_Box(5,Menu_Y + 1,76,Menu_Y + 12,0,M_B_Color,'FILE ' + Direction + 'LOAD'
  77.         ,True);
  78.     Write('Press <CtrlX> to abort',29,Menu_Y + 11,0,M_B_Color);
  79.  
  80. {We must not swap ME out for this since we use some of the kernal's routines}
  81.     GotoXY(6,Menu_Y + 2);
  82.  
  83. {We must not swap ME out for this since we use some of the kernal's routines}
  84.     RETURN_STR := me_path + 'MEFT.EXE ' + prot + ' ' + Copy(Direction,1,1) +
  85.         ' ' + Str( port_num ) + ' ' + tstr;
  86.     RM('MEUTIL1^EXEC /SWAP=1');
  87.     Return_Int := -1;
  88.     write_com( port_num, '|17|13', jx );
  89.     error := Exit_Code;
  90.     IF (Error = 10) THEN
  91.         Error := 0;
  92.     END;
  93.     If error <> 0 then
  94.         IF ((Error > 66) and (Error < 70)) THEN
  95.             TSTR := Protocol + ' ' + Lower(Direction) +
  96.             'load cancelled by ' + Remove_Space(Copy('sender  receiveruser',
  97.             ((Error - 67) * 8) + 1,8)) +    '.';
  98.         ELSE
  99.             Return_Int := Error;
  100.             RM('MECOM^COM_ERROR');
  101.             Tstr := Protocol + ' error - ' + Return_Str;
  102.             Return_Int := -1;
  103.         END;
  104.     ELSE
  105.         IF (Error_Level <> 0) THEN
  106.                 RM('Meerror');
  107.                 TSTR := Protocol + ' ' + Lower(Direction) +'load terminated.';
  108.         ELSE
  109.             TSTR := Protocol + ' ' +
  110.                 Copy('receivesend',((Direction = 'UP') * 7) + 1,7) + ' of ' + TStr +
  111.                 ' complete.';
  112.             Return_Int := 0;
  113.         END;
  114.     end;
  115.     RM('MECOM^COM_XFER_BEEP');
  116.     Write(Tstr,6,Menu_Y + 10,0,M_S_Color);
  117.     Write('════Press any key═════',29,Menu_Y + 11,0,M_B_Color);
  118.     Read_Key;
  119.     Kill_Box;
  120. exit:
  121. END_MACRO;
  122.  
  123. $MACRO COM_DSZ_XFER TRANS;
  124. {*******************************MULTI-EDIT MACRO*******************************
  125.  
  126. Name:    COM_DSZ_XFER
  127.  
  128. Description:    A comunications module macro.  Provides an interface to the
  129. external protocol program DSZ.
  130.  
  131. Parameters:
  132.                             /CMD= The DSZ command(usually indicates protocol and direction),
  133.                             but may include the following aliases:
  134.                                     <DLDIR>  Will insert the user-defined download directory
  135.                                     specification if one exists.
  136.                                     <ULDIR>  Will insert the user-defined upload directory
  137.                                     specification if one exists.
  138.                                     <FILE>  Will insert /FN=.
  139.  
  140.                             /FN= The file name.  Not used if /BATCH= <> ''.
  141.                             /BATCH= If = '', then use /FN= for single file transfer.
  142.                             Otherwise, indicates the name of the file containing filenames
  143.                             for batch transfer.
  144.                             /NPX= if 1, don't use the DSZ portx command, but instead use the
  145.                                         default COM1 or COM2 address and interrupt.  Only to be
  146.                                         used if your version of DSZ does not support the portx
  147.                                         command.
  148.  
  149. Returns:
  150.                             Return_Int = 0 - Transfer was probably successful(Provided you
  151.                             don't use COMMAND.COM to run DSZ)
  152.                             Return_Int = -1 - Transfer was unsuccessful.
  153.  
  154.                              (C) Copyright 1990 by American Cybernetics, Inc.
  155. ******************************************************************************}
  156.     Def_Str(Port_Str[2],Command_Line,Batch[80]);
  157.     Def_Int(File_Count,Active_Window,Error,T_Int);
  158.  
  159.     Port_Str := Str(global_int('COM_PORT_NUM'));
  160.     Command_Line := Parse_Str('/CMD=',MParm_Str);
  161. {Check for special aliases in command line and process accordingly}
  162.     T_Int := XPos('<DLDIR>',Caps(Command_Line),1);
  163.     IF (T_Int > 0) THEN
  164.         Return_Str := Parse_Str('/DP=',Global_Str('Com_General_Params'));
  165. {Strip trailing backslash}
  166.         Return_Str := Copy(Return_Str,1,Length(Return_Str) - 1);
  167.         Command_Line := Copy(Command_Line,1,T_Int - 1) + Return_Str +
  168.             Copy(Command_Line,T_Int + 7,255);
  169.     END;
  170.     T_Int := XPos('<ULDIR>',Caps(Command_Line),1);
  171.     IF (T_Int > 0) THEN
  172.         Command_Line := Copy(Command_Line,1,T_Int - 1) +
  173.             Parse_Str('/UP=',Global_Str('Com_General_Params')) +
  174.             Copy(Command_Line,T_Int + 7,255);
  175.     END;
  176.     T_Int := XPos('<FILE>',Caps(Command_Line),1);
  177.     IF (T_Int > 0) THEN
  178.         Command_Line := Copy(Command_Line,1,T_Int - 1) +
  179.             Parse_Str('/FN=',MParm_Str) +
  180.             Copy(Command_Line,T_Int + 6,255);
  181.     END;
  182.  
  183.     Batch := Parse_Str('/BATCH=',MParm_Str);
  184.     IF (Batch <> '') THEN
  185.         Command_Line := Command_Line + ' @' + Batch;
  186.     END;
  187.  
  188. {This will insure that we have the best chance of being able to have enough
  189.  room to run DSZ}
  190.  
  191. {This SHELL_TO_DOS statement uses COMMAND.COM run DSZ.  We leave it there
  192. just in case the one below does not work.  Just be sure that the DOS path
  193. in the environment includes the directory where DSZ.COM or DSZ.EXE resides!
  194.     Shell_To_Dos('DSZ portx ' +
  195.         Lower(Hex_Str(Parse_Int('/A' + Port_Str + '=',Global_Str('Com_Line_Params'))))
  196.         + ',' + Parse_Str('/I' + Port_Str + '=',
  197.         Global_Str('Com_Line_Params')) + ' ' + Command_Line,True );
  198. }
  199.  
  200. {This SHELL_TO_DOS statement uses the EXEC function to run DSZ.COM.  We use our
  201. own path search routine using the DOS path.  The advantage here is that
  202. we will return an error level, whereas COMMAND.COM will not}
  203.  
  204.     Return_Str := Get_Environment('PATH') + ';' + Me_Path;
  205.     RM('PATHSEARCH /F=DSZ.COM');
  206.     if (return_int = 0) then
  207. {If we can't find DSZ.COM, look for DSZ.EXE}
  208.      RM('PATHSEARCH /F=DSZ.EXE');
  209.     end;
  210.     if (return_Int = 0) then
  211.         ERROR_LEVEL := 3002;
  212.         RM('MEERROR /EM=THE PROGRAM DSZ NOT FOUND!');
  213.         Error := 3002;
  214.         Goto NO_PROGRAM;
  215.      else
  216. {01-31-90 03:38pm - I just discovered that not all versions of DSZ support the
  217. portx command.  This is unfortunately very bad if you want to use it for
  218. MECOM, since MECOM allows up to 8 com ports and you can specify any address
  219. and interrupt you wish for each.  Portx is the only way I know to tell DSZ
  220. an explicit address and interrupt.  If the user has a version of DSZ that does
  221. not support portx, the only way he can use it in MECOM is if he restricts his
  222. com port activity to COM1 or COM2, using the following addresses and
  223. interrupts:
  224. COM1 address 3F8 interrupt 4
  225. COM2 address 2F8 interrupt 3
  226.  
  227. After the above criteria are met, the user can add to the macro command line
  228. of every file transfer record that calls this macro:
  229. /NPX=1
  230. }
  231.         IF (Parse_Int('/NPX=',Mparm_Str)) THEN
  232.             return_str := Return_Str + ' port ' + Port_Str + ' ' + Command_Line;
  233.         ELSE
  234.             return_str := Return_Str + ' portx ' +
  235.             Lower(Hex_Str(Parse_Int('/A' + Port_Str + '=',Global_Str('Com_Line_Params'))))
  236.             + ',' + Parse_Str('/I' + Port_Str + '=',
  237.             Global_Str('Com_Line_Params')) + ' ' + Command_Line;
  238.         END;
  239.         RM('MEUTIL1^EXEC /MEM=5500/CMD=0/SWAP=0/SCREEN=1');
  240.      end;
  241.  
  242.         Return_Int := 0;
  243.     Error := Exit_Code;
  244. NO_PROGRAM:
  245.     IF (Error) THEN
  246.         Error_Level := Error;
  247.         RM('MEERROR /EM=DSZ error: ' + str(Error));
  248.         Return_Int := -1;
  249.     ELSIF (Error_Level) THEN
  250.         RM('MEERROR');
  251.         Return_Int := -1;
  252.     ELSE
  253.         RM('MECOM^COM_XFER_BEEP');
  254.     END;
  255. ABORT:
  256. END_MACRO;
  257.  
  258. $MACRO COM_LOG_MAJORBBS TRANS;
  259. {*******************************MULTI-EDIT MACRO*******************************
  260.  
  261. Name:    COM_LOG_MAJORBBS
  262.  
  263. Description:    A comunications module macro.  Automatically logs on to
  264. Galacticom's MajorBBS boards if you are registered, and if you have your
  265. user id in the first name field, and your password field entered in the
  266. phone dialing list.
  267.  
  268.                              (C) Copyright 1990 by American Cybernetics, Inc.
  269. ******************************************************************************}
  270. {Need to log on and confirm the prompts}
  271.  
  272.     Def_Str(First_Name[9],Password[9]);
  273.     Def_Int(Jx);
  274.  
  275. {Take first name from phone number global}
  276.  
  277.     First_Name := Parse_Str('FN=',Global_Str('PHONE'));
  278.  
  279.     IF (First_Name = '') THEN
  280.         RM('MEERROR^MessageBox /T=ERROR/M=Logon parameters not found!');
  281.         Goto EXIT;
  282.     ELSE
  283.         Password := Parse_Str('PW=',Global_Str('PHONE'));
  284.     END;
  285.  
  286. {Wait for a connection}
  287.     RM('MECOM^COM_CONNECT_WAIT ' + MParm_Str);
  288.     IF (Return_Int = 0) THEN
  289.         Goto EXIT;
  290.     END;
  291.  
  292. {Wait for the user id prompt for 60 seconds}
  293.     RM('MECOM^COM_WAIT_FOR_STR /T=60/S1="new":');
  294.     IF (Return_Int < 1) THEN
  295.         Goto EXIT;
  296.     END;
  297.  
  298. {Send user id}
  299.     Return_Str := First_Name + '|13';
  300.     RM('MECOM^COM_SEND_STR /T=10');
  301.     IF (Return_Int < 1) THEN
  302.         Goto EXIT;
  303.     END;
  304.  
  305. {Wait for the password prompt for 60 seconds}
  306.     RM('MECOM^COM_WAIT_FOR_STR /T=60/S1=Password');
  307.     IF (Return_Int < 1) THEN
  308.         Goto EXIT;
  309.     END;
  310.  
  311. {Send password}
  312.     Return_Str := Password + '|13';
  313.     RM('MECOM^COM_SEND_STR /T=10');
  314.     IF (Return_Int < 1) THEN
  315.         Goto EXIT;
  316.     END;
  317.  
  318. EXIT:
  319. END_MACRO;
  320.  
  321. $MACRO COM_LOG_WBBS TRANS;
  322. {*******************************MULTI-EDIT MACRO*******************************
  323.  
  324. Name:    COM_LOG_WBBS
  325.  
  326. Description:    A comunications module macro.  Automatically logs on to WBBS
  327. boards if you are registered, and if you have your first and last name, and
  328. your password fields entered in the phone dialing list.  Optionally captures
  329. all mail and/or messages to the file WBBS.LOG.
  330.  
  331. Parameters:
  332.                             /MSG=1 Capture messages to WBBS.LOG
  333.                             /MAIL=1 Capture Mail to WBBS.LOG
  334.                             /LOGOFF=1 Log off at the end.
  335.  
  336.                              (C) Copyright 1990 by American Cybernetics, Inc.
  337. ******************************************************************************}
  338.  
  339.     Def_Str(First_Name[20],Last_Name[20],Password[20],ASCII_NAME[80]);
  340.     Def_Int(Jx,Resume_Ascii_Download,Capture,Capture_Mail,Capture_Messages,
  341.                     Log_Open);
  342.  
  343. {Take first name from phone number global}
  344.  
  345.     First_Name := Parse_Str('FN=',Global_Str('PHONE'));
  346.  
  347.     IF (First_Name = '') THEN
  348.         RM('MEERROR^MessageBox /T=ERROR/M=Logon parameters not found!');
  349.         Goto EXIT;
  350.     ELSE
  351.         Last_Name := Parse_Str('LN=',Global_Str('PHONE'));
  352.         Password := Parse_Str('PW=',Global_Str('PHONE'));
  353.     END;
  354.  
  355.     Capture_Messages := Parse_Int('/MSG=',MParm_Str);
  356.     Capture_Mail := Parse_Int('/MAIL=',MParm_Str);
  357.  
  358. {Wait for a connection}
  359.     RM('MECOM^COM_CONNECT_WAIT ' + MParm_Str);
  360.     IF (Return_Int = 0) THEN
  361.         Goto EXIT;
  362.     END;
  363.  
  364.  
  365. {Wait for the WBBS name prompt for 60 seconds}
  366.     RM('MECOM^COM_WAIT_FOR_STR /T=60/S1=Enter your first and last name:');
  367.     IF (Return_Int < 1) THEN
  368.         Goto EXIT;
  369.     END;
  370.  
  371. {Send first and last name}
  372.     Return_Str := First_Name + ' ' + Last_Name + '|13';
  373.     RM('MECOM^COM_SEND_STR /T=10');
  374.     IF (Return_Int < 1) THEN
  375.         Goto EXIT;
  376.     END;
  377.  
  378. {Wait for the WBBS password prompt for 60 seconds}
  379.     RM('MECOM^COM_WAIT_FOR_STR /T=60/S1=Password?');
  380.     IF (Return_Int < 1) THEN
  381.         Goto EXIT;
  382.     END;
  383.  
  384. {Send password}
  385.     Return_Str := Password + '|13';
  386.     RM('MECOM^COM_SEND_STR /T=10');
  387.     IF (Return_Int < 1) THEN
  388.         Goto EXIT;
  389.     END;
  390.  
  391.     IF ((Capture_Messages and Capture_Mail) = 0) THEN
  392.         Goto EXIT;
  393.     END;
  394.  
  395. {Wait for the WBBS mail prompt for 60 seconds}
  396. {Notice the two slashes(//) between the Y and n.  This is because, the
  397. Parse_Str function used by COM_WAIT_FOR_STR to parse out the string will
  398. return a single slash if a double slash is encountered}
  399.     RM('MECOM^COM_WAIT_FOR_STR /T=60/S1=You have mail waiting.  Read it? (Y//n):'
  400.              + '/S2=Sorry, no mail for you today');
  401.     IF (Return_Int < 1) THEN
  402.         Goto EXIT;
  403.     END;
  404.     Jx := Return_Int;
  405.  
  406. {Begin an ASCII download to capture all mail, messages, etc.}
  407. {If we are already ASCII downloading, close that file and we will reopen it
  408. at the conclusion of this macro.}
  409.  
  410.     IF (Global_Int('COM_ASCII_DOWNLOAD')) THEN
  411.         Ascii_Name := Global_Str('COM_ASCII_FILENAME');
  412.         RM('COM_ASCII_DOWN /QUIT=1');
  413.         Resume_Ascii_Download := True;
  414.     ELSE
  415.         Resume_Ascii_Download := False;
  416.     END;
  417.  
  418.  
  419. {If there is mail waiting, get it captured to the file}
  420.  
  421.     IF (Jx = 1) THEN
  422.         Return_Str :=  'Y|13';
  423.         RM('MECOM^COM_SEND_STR /T=10');
  424.         IF (Return_Int < 1) THEN
  425.             Goto RESUME_ASCII;
  426.         END;
  427.  
  428.         IF (Capture_Mail) THEN
  429.             Return_Str := 'WBBS.LOG';
  430.             RM('COM_ASCII_DOWN /OVERWRITE=1');
  431.             Log_Open := True;
  432.         ELSE
  433.             Log_Open := False;
  434.         END;
  435.  
  436. MORE_MAIL:
  437. {Wait for 60 seconds for more mail}
  438.         RM('MECOM^COM_WAIT_FOR_STR /T=60/S1=Mail:/S2=<Press ENTER>/S3=(? for menu):');
  439.         IF (Return_Int < 1) THEN
  440.             Goto CLOSE;
  441.         END;
  442.         Jx := Return_Int;
  443.         Return_Str :=  '|13';
  444.         IF (Jx = 3) THEN
  445.             Return_Str := 'Z' + Return_Str;
  446.         END;
  447.         RM('MECOM^COM_SEND_STR /T=10');
  448.         IF (Return_Int < 1) THEN
  449.             Goto CLOSE;
  450.         END;
  451.         IF (Jx < 3) THEN
  452.             Goto MORE_MAIL;
  453.         END;
  454.     END;
  455.  
  456.     IF (Capture_Messages) THEN
  457.         IF (Log_Open = False) THEN
  458.             Return_Str := 'WBBS.LOG';
  459.             RM('COM_ASCII_DOWN /OVERWRITE=1');
  460.             Log_Open := True;
  461.         END;
  462.     ELSE
  463.         IF (Log_Open) THEN
  464.             RM('COM_ASCII_DOWN /QUIT=1');
  465.         END;
  466.         Log_Open := False;
  467.     END;
  468.  
  469. MORE_MESSAGES:
  470. {Wait for 60 seconds for more messages}
  471.         RM('MECOM^COM_WAIT_FOR_STR /T=60/S1=(? for menu):/S2=<Press ENTER>/S3=Done with zip read');
  472.         IF (Return_Int < 1) THEN
  473.             Goto CLOSE;
  474.         END;
  475.         IF (Return_int < 3) THEN
  476.             Return_Str :=  '|13';
  477.             RM('MECOM^COM_SEND_STR /T=10');
  478.             IF (Return_Int < 1) THEN
  479.                 Goto CLOSE;
  480.             END;
  481.             Goto MORE_MESSAGES;
  482.         END;
  483.  
  484. {Log off}
  485.         IF (Parse_Int('/LOGOFF=',MParm_Str)) THEN
  486.             Return_Str :=  'GY|13';
  487.             RM('MECOM^COM_SEND_STR /T=10');
  488.             IF (Return_Int < 1) THEN
  489.                 Goto CLOSE;
  490.             END;
  491.         END;
  492.  
  493.  
  494. CLOSE:
  495. {Close the capture file}
  496.         IF (Log_Open) THEN
  497.             RM('COM_ASCII_DOWN /QUIT=1');
  498.         END;
  499.  
  500. RESUME_ASCII:
  501. {If we were downloading ascii before, resume by appending}
  502.  
  503.     IF (Resume_ASCII_DOWNLOAD) THEN
  504.         Return_Str := Ascii_Name;
  505.         RM('COM_ASCII_DOWN /APPEND=1');
  506.     END;
  507.  
  508. EXIT:
  509. END_MACRO;
  510.  
  511. $MACRO COM_LOG_COMPU TRANS;
  512. {*******************************MULTI-EDIT MACRO*******************************
  513.  
  514. Name:    COM_LOG_COMPU
  515.  
  516. Description:    A comunications module macro.  Automatically logs on to
  517. COMPUSERVE.  You must have your user id entered as the first name, and your
  518. password entered in the phone dialing list.
  519.  
  520.                              (C) Copyright 1990 by American Cybernetics, Inc.
  521. ******************************************************************************}
  522.  
  523.     Def_Str(First_Name[20],Password[20]);
  524.  
  525. {Take first name from phone number global}
  526.  
  527.     First_Name := Parse_Str('FN=',Global_Str('PHONE'));
  528.  
  529.     IF (First_Name = '') THEN
  530.         RM('MEERROR^MessageBox /T=ERROR/M=Logon parameters not found!');
  531.         Goto EXIT;
  532.     ELSE
  533.         Password := Parse_Str('PW=',Global_Str('PHONE'));
  534.     END;
  535.  
  536. {Wait for a connection}
  537.     RM('MECOM^COM_CONNECT_WAIT ' + MParm_Str);
  538.     IF (Return_Int = 0) THEN
  539.         Goto EXIT;
  540.     END;
  541.  
  542. {Send a carriage return}
  543.     Return_Str := '|13';
  544.     RM('MECOM^COM_SEND_STR /T=10');
  545.     IF (Return_Int < 1) THEN
  546.         Goto EXIT;
  547.     END;
  548.  
  549. {Wait for the host name prompt for 60 seconds}
  550.     RM('MECOM^COM_WAIT_FOR_STR /EI=4/T=60/S1=Host Name:');
  551.     IF (Return_Int < 1) THEN
  552.         Goto EXIT;
  553.     END;
  554.  
  555. {Send Host name CIS}
  556.     Return_Str := 'CIS|13';
  557.     RM('MECOM^COM_SEND_STR /T=10');
  558.     IF (Return_Int < 1) THEN
  559.         Goto EXIT;
  560.     END;
  561.  
  562. {Wait for the user id prompt for 60 seconds}
  563.     RM('MECOM^COM_WAIT_FOR_STR /EI=4/T=60/S1=User ID:');
  564.     IF (Return_Int < 1) THEN
  565.         Goto EXIT;
  566.     END;
  567.  
  568. {Send user id (first name)}
  569.     Return_Str := First_Name + '|13';
  570.     RM('MECOM^COM_SEND_STR /T=10');
  571.     IF (Return_Int < 1) THEN
  572.         Goto EXIT;
  573.     END;
  574.  
  575. {Wait for the password prompt for 60 seconds}
  576.     RM('MECOM^COM_WAIT_FOR_STR /EI=4/T=60/S1=Password:');
  577.     IF (Return_Int < 1) THEN
  578.         Goto EXIT;
  579.     END;
  580.  
  581. {Send password}
  582.     Return_Str := Password + '|13';
  583.     RM('MECOM^COM_SEND_STR /T=10');
  584.     IF (Return_Int < 1) THEN
  585.         Goto EXIT;
  586.     END;
  587.  
  588. EXIT:
  589. END_MACRO;
  590.  
  591. $MACRO COM_LOG_RBBS TRANS;
  592. {*******************************MULTI-EDIT MACRO*******************************
  593.  
  594. Name:    COM_LOG_RBBS
  595.  
  596. Description:    A comunications module macro.  Automatically logs on to RBBS.
  597. You must have your first name, last name, and password entered in the phone
  598. dialing list.
  599.  
  600.                              (C) Copyright 1990 by American Cybernetics, Inc.
  601. ******************************************************************************}
  602.  
  603.     Def_Str(First_Name[20],Last_Name[20],Password[20]);
  604.  
  605. {Take first name from phone number global}
  606.  
  607.     First_Name := Parse_Str('FN=',Global_Str('PHONE'));
  608.  
  609.     IF (First_Name = '') THEN
  610.         RM('MEERROR^MessageBox /T=ERROR/M=Logon parameters not found!');
  611.         Goto EXIT;
  612.     ELSE
  613.         Last_Name := Parse_Str('LN=',Global_Str('PHONE'));
  614.         Password := Parse_Str('PW=',Global_Str('PHONE'));
  615.     END;
  616.  
  617. {Wait for a connection}
  618.     RM('MECOM^COM_CONNECT_WAIT ' + MParm_Str);
  619.     IF (Return_Int = 0) THEN
  620.         Goto EXIT;
  621.     END;
  622.  
  623. {Send an escape character.  Seems most RBBS and PCBoards expect this}
  624.     Return_Str := '|27';
  625.     RM('MECOM^COM_SEND_STR /T=10');
  626.     IF (Return_Int < 1) THEN
  627.         Goto EXIT;
  628.     END;
  629.  
  630. {Wait for the first name prompt for 60 seconds}
  631.     RM('MECOM^COM_WAIT_FOR_STR /T=60/S1=What is your FIRST name?');
  632.     IF (Return_Int < 1) THEN
  633.         Goto EXIT;
  634.     END;
  635.  
  636. {Send first name, last name, and password in RBBS shorthand}
  637.     Return_Str := First_Name + ';' + Last_Name + ';' + Password + '|13';
  638.     RM('MECOM^COM_SEND_STR /T=10');
  639.     IF (Return_Int < 1) THEN
  640.         Goto EXIT;
  641.     END;
  642.  
  643. EXIT:
  644. END_MACRO;
  645.