home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / MODEMS / TX_HST11.ZIP / TLX_HST.SLT < prev    next >
Encoding:
Text File  |  1989-05-03  |  58.3 KB  |  1,757 lines

  1. ////////////////////////////////////////////////////////////////////////
  2. //                                                                    //
  3. //  TLX_HST Service Script, Release 1.1                               //
  4. //                                                                    //
  5. //  For Telix SALT version 3.11                                       //
  6. //                                                                    //
  7. //  (c) Andrzej Taramina, 1989                                        //
  8. //                                                                    //
  9. ////////////////////////////////////////////////////////////////////////
  10.  
  11. int CONT_OK = 0;                       // Global function return codes
  12. int GET_OUT  = 99;
  13. int TIME_OUT = 98;
  14.  
  15. int BOX_COLOUR = 62;                   // display colours
  16. int TXT_COLOUR = 48;
  17.  
  18. str VERSION[3] = "1.1";                // Version Number
  19.  
  20. main()
  21.  {
  22.   str menu[1] = "M";
  23.   str rom_level[4] = "";
  24.   str func[2];
  25.   int save_scr;
  26.   int t1, t2, t3, t4, t5;
  27.   int stat;
  28.   int ret_code = 0;
  29.   int ran_fn;
  30.   int time_handle;
  31.   int old_baud, old_datab, old_parity, old_stopb;
  32.  
  33.   save_scr = vsavearea(0,0,79,24);
  34.   clear_scr();
  35.   if (carrier())
  36.      {
  37.       clear_scr();
  38.       prints("This Script MUST be run OFFLINE (in terminal mode)");
  39.       prints("Script terminated due to above error.");
  40.       delay(40);
  41.       vrstrarea(save_scr);
  42.       return(-1);
  43.      }
  44.  
  45.   t1 = track("961",0);
  46.   t2 = track("963",0);
  47.   t3 = track("964",0);
  48.   t4 = track("1440",0);
  49.   t5 = track("OK",0);
  50.  
  51.   flushbuf();
  52.   cputs("ATI0^M");
  53.   time_handle = timer_start(20);
  54.   while (1)
  55.      {
  56.       terminal();
  57.       stat = track_hit(0);
  58.       if (stat == t1)
  59.          {
  60.           rom_level = "961";
  61.           break;
  62.          }
  63.       else if (stat == t2)
  64.               {
  65.                rom_level = "963";
  66.                break;
  67.               }
  68.       else if (stat == t3)
  69.               {
  70.                rom_level = "964";
  71.                break;
  72.               }
  73.       else if (stat == t4)
  74.               {
  75.                rom_level = "1440";
  76.                break;
  77.               }
  78.       else if (stat == t5)
  79.               break;
  80.       else if (time_up(time_handle))
  81.               break;
  82.      }
  83.  
  84.   track_free(0);
  85.   timer_free(time_handle);
  86.   if (rom_level == "")
  87.      {
  88.       clear_scr();
  89.       prints("Sorry, your modem is not a USRobotics Courier HST or");
  90.       prints("the ROM level is higher than 1440 or lower than 961.");
  91.       prints("HST Service Script terminated due to above error.");
  92.       delay (40);
  93.       vrstrarea(save_scr);
  94.       return(-1);
  95.      }
  96.  
  97.   cputs("AT&B0^M");
  98.   old_baud   = get_baud();                     // save old connect parms
  99.   old_parity = get_parity();
  100.   old_datab  = get_datab();
  101.   old_stopb  = get_stopb();
  102.   set_cparams(2400,0,8,1);
  103.   _local_echo = 1;
  104.  
  105.   while (ret_code == CONT_OK)
  106.      {
  107.       if (menu == "M")
  108.          main_menu(rom_level);
  109.       else
  110.          adv_menu(rom_level);
  111.       ran_fn = 1;
  112.       flushbuf();
  113.       gotoxy(56,18);
  114.       gets(func,2);
  115.       if (menu == "M")
  116.          {
  117.           if (func == "1") ret_code = get_level();
  118.           else if (func == "2")  ret_code = chk_sum();
  119.           else if (func == "3")  ret_code = ram_test();
  120.           else if (func == "4")  ret_code = current_set();
  121.           else if (func == "5")  ret_code = nram_set();
  122.           else if (func == "6")  ret_code = set_clock();
  123.           else if (func == "7")  ret_code = disp_phone();
  124.           else if (func == "8")  ret_code = basic_help();
  125.           else if (func == "9")  ret_code = ext_help();
  126.           else if (func == "10") ret_code = dial_help();
  127.           else if (func == "11") ret_code = set_sregs();
  128.           else if (func == "12") ret_code = switch_help();
  129.           else if (func == "13") ret_code = interface_test();
  130.           else if (func == "14") ret_code = analog_loop();
  131.           else if (func == "15") ret_code = freq_test();
  132.           else if (func == "16") ret_code = data_mode();
  133.           else if (func == "17") ret_code = set_to_nram();
  134.           else if (func == "18") ret_code = write_nram();
  135.           else if (func == "19") ret_code = dial_phone();
  136.           else if (func == "20") ret_code = link_diag();
  137.           else if (func == "21") ret_code = set_s13reg();
  138.           else if (func == "TX") ret_code = telix_def(rom_level);
  139.           else if (func == "tx") ret_code = telix_def(rom_level);
  140.           else if (func == "PC") ret_code = pcboard_def(rom_level);
  141.           else if (func == "pc") ret_code = pcboard_def(rom_level);
  142.           else if ((func == "AD" or func == "ad") and
  143.                   (rom_level >= "964" or rom_level == "1440"))
  144.                   {
  145.                    menu = "A";
  146.                    ran_fn = 0;
  147.                    continue;
  148.                   }
  149.           else if (func == "99") break;
  150.           else
  151.              {
  152.               tone(400,50);
  153.               ran_fn = 0;
  154.              }
  155.          }
  156.  
  157.       if (menu == "A")
  158.          {
  159.           if (func == "50") ret_code = disable_comp();
  160.           else if (func == "51") ret_code = auto_comp();
  161.           else if (func == "52") ret_code = enable_comp();
  162.           else if (func == "53") ret_code = set_s15reg();
  163.           else if (func == "54") ret_code = set_rate();
  164.           else if (func == "55") ret_code = modem_inq();
  165.           else if (func == "98")
  166.              {
  167.               menu = "M";
  168.               ran_fn = 0;
  169.              }
  170.           else if (func == "99") break;
  171.           else
  172.              {
  173.               tone(400,50);
  174.               ran_fn = 0;
  175.              }
  176.          }
  177.       if (ran_fn and ret_code == CONT_OK)
  178.          {
  179.           gotoxy(18,23);
  180.           printsc("Press (Enter) to return to function menu......");
  181.           flushbuf();
  182.           gotoxy(0,0);
  183.           inkeyw();
  184.          }
  185.      }
  186.  
  187.  
  188.   if (ret_code == TIME_OUT)
  189.      {
  190.       clear_scr();
  191.       prints("WAITFOR timeout: expected response not received after 20 seconds");
  192.       prints("Script terminated....");
  193.       delay(30);
  194.      }
  195.  
  196.   clear_scr();
  197.   gotoxy(0,0);
  198.   prints("USR TLX_HST SERVICE SCRIPT - EXIT");
  199.   prints(" ");
  200.   prints("Thanks for using TLX_HST and TELIX.  Have a nice day.");
  201.   delay(10);
  202.   set_cparams(old_baud,old_parity,old_datab,old_stopb);
  203.   _local_echo = 1;
  204.   vrstrarea(save_scr);
  205.   return(0);
  206.  }
  207.  
  208. ////////////////////////////////////////////////////////////////////////
  209. //                                                                    //
  210. //  Function to display Main Menu                                     //
  211. //                                                                    //
  212. ////////////////////////////////////////////////////////////////////////
  213.  
  214. main_menu(str rom_level)
  215.  {
  216.   clear_scr();
  217.   pstraxy("              ┌────────────────────────────────────────────┐              ",3,00,30);
  218.   pstraxy("╒═════════════╡ USR COURIER HST - TXL_HST MAIN MENU   v    ╞═════════════╕",3,01,30);
  219.   pstraxy(VERSION,58,1,30);
  220.   pstraxy("│             └────────────────────────────────────────────┘             │",3,02,30);
  221.   pstraxy("│  1.  Display HST ROM Level             13. Check Modem-PC Interface    │",3,03,30);
  222.   pstraxy("│  2.  Display HST Memory Checksum       14. Self-Test: Analog Loopback  │",3,04,30);
  223.   pstraxy("│  3.  HST RAM Test                      15. Self-Test: Answer Frequency │",3,05,30);
  224.   pstraxy("│  4.  Display HST RAM Settings          16. Self-Test: Reset Data Mode  │",3,06,30);
  225.   pstraxy("│  5.  Display HST NRAM Settings         17. Reset Modem to NRAM Default │",3,07,30);
  226.   pstraxy("│  6.  Display/Set Internal TOD Clock    18. Copy RAM Settings to NRAM   │",3,08,30);
  227.   pstraxy("│  7.  Display/Store Internal Phone #s   19. Dial a number & exit        │",3,09,30);
  228.   pstraxy("│  8.  Display Basic Command Help        20. Link Diagnostics display    │",3,10,30);
  229.   pstraxy("│  9.  Display Extended Command Help     21. S13 register settings       │",3,11,30);
  230.   pstraxy("│ 10.  Display Dial Command Help                                         │",3,12,30);
  231.   pstraxy("│ 11.  Display S-Reg Help/Set S-Reg      TX. Set Telix 3.11 defaults     │",3,13,30);
  232.   pstraxy("│ 12.  Display Modem Switch Help         PC. Set PCboard 14.x defaults   │",3,14,30);
  233.   pstraxy("│                                        99. Exit                        │",3,15,30);
  234.   pstraxy("╞════════════════════════════════════════════════════════════════════════╡",3,16,30);
  235.   pstraxy("│                                                                        │",3,17,30);
  236.   pstraxy("│            Type desired function code and (Enter): __                  │",3,18,30);
  237.   pstraxy("│ ┌──────────┐                                   ┌─────────────────────┐ │",3,19,30);
  238.   pstraxy("╘═╡ AJT 1989 ╞═══════════════════════════════════╡ HST ROM Level:      ╞═╛",3,20,30);
  239.   pstraxy("  └──────────┘                                   └─────────────────────┘  ",3,21,30);
  240.   pstraxy(rom_level,69,20,30);
  241.   if (rom_level >= "964" or rom_level == "1440")
  242.       pstraxy("AD. Advanced Functions",44,12,30);
  243.  }
  244.  
  245. ////////////////////////////////////////////////////////////////////////
  246. //                                                                    //
  247. //  Function to display Advanced Functions Menu                       //
  248. //                                                                    //
  249. ////////////////////////////////////////////////////////////////////////
  250.  
  251. adv_menu(str rom_level)
  252.  {
  253.   clear_scr();
  254.   pstraxy("              ┌────────────────────────────────────────────┐              ",3,00,30);
  255.   pstraxy("╒═════════════╡ USR COURIER HST - TLX_HST ADVANCED FN'S    ╞═════════════╕",3,01,30);
  256.   pstraxy("│             └────────────────────────────────────────────┘             │",3,02,30);
  257.   pstraxy("│ 50.  Disable data compression                                          │",3,03,30);
  258.   pstraxy("│ 51.  Auto enable/disable compression                                   │",3,04,30);
  259.   pstraxy("│ 52.  Enable data compression                                           │",3,05,30);
  260.   pstraxy("│ 53.  S15 register settings                                             │",3,06,30);
  261.   pstraxy("│ 54.  Set modem-to-modem link rate                                      │",3,07,30);
  262.   pstraxy("│ 55.  Modem configuration inquiry                                       │",3,08,30);
  263.   pstraxy("│                                                                        │",3,09,30);
  264.   pstraxy("│ 98.  Return to Main Menu                                               │",3,10,30);
  265.   pstraxy("│ 99.  EXIT                                                              │",3,11,30);
  266.   pstraxy("│                                                                        │",3,12,30);
  267.   pstraxy("│                                                                        │",3,13,30);
  268.   pstraxy("│                                                                        │",3,14,30);
  269.   pstraxy("│                                                                        │",3,15,30);
  270.   pstraxy("╞════════════════════════════════════════════════════════════════════════╡",3,16,30);
  271.   pstraxy("│                                                                        │",3,17,30);
  272.   pstraxy("│            Type desired function code and (Enter): __                  │",3,18,30);
  273.   pstraxy("│ ┌──────────┐                                   ┌─────────────────────┐ │",3,19,30);
  274.   pstraxy("╘═╡ AJT 1989 ╞═══════════════════════════════════╡ HST ROM Level:      ╞═╛",3,20,30);
  275.   pstraxy("  └──────────┘                                   └─────────────────────┘  ",3,21,30);
  276.   pstraxy(rom_level,69,20,30);
  277.  }
  278.  
  279. ////////////////////////////////////////////////////////////////////////
  280. //                                                                    //
  281. //  Function to dial a number and exit                                //
  282. //                                                                    //
  283. ////////////////////////////////////////////////////////////////////////
  284.  
  285. dial_phone()
  286.  {
  287.   str prefix[4];
  288.   str number[25];
  289.  
  290.   while (1)
  291.      {
  292.       clear_scr();
  293.       prints("(T) for tone, (P) for pulse dialing and (Enter)...");
  294.       gotoxy(0,2);
  295.       gets(prefix,1);
  296.       if (prefix == "t" or prefix == "T")
  297.          {
  298.           prefix = "ATDT";
  299.           break;
  300.          }
  301.       if (prefix == "p" or prefix == "P")
  302.          {
  303.           prefix = "ATDP";
  304.           break;
  305.          }
  306.       tone(450,50);
  307.      }
  308.  
  309.   gotoxy(0,5);
  310.   prints("Type desired telephone number and (Enter)");
  311.   gotoxy(0,7);
  312.   gets(number,25);
  313.   gotoxy(0,9);
  314.   hangup();
  315.   prints("Exiting TLX_HST and dialling......");
  316.   cputs(prefix);
  317.   cputs(number);
  318.   cputs("^M");
  319.   return(GET_OUT);
  320.  }
  321.  
  322. ////////////////////////////////////////////////////////////////////////
  323. //                                                                    //
  324. //  Function to display HST ROM level                                 //
  325. //                                                                    //
  326. ////////////////////////////////////////////////////////////////////////
  327.  
  328. get_level()
  329.  {
  330.   clear_scr();
  331.   prints("USR HST ROM LEVEL DISPLAY -- ATI0");
  332.   cputs("ATI0^M");
  333.   if (waitfor("OK",10))
  334.      return(CONT_OK);
  335.   else
  336.      return(TIME_OUT);
  337.  }
  338.  
  339. ////////////////////////////////////////////////////////////////////////
  340. //                                                                    //
  341. //  Function to display HST memory check_sum                          //
  342. //                                                                    //
  343. ////////////////////////////////////////////////////////////////////////
  344.  
  345. chk_sum()
  346.  {
  347.   clear_scr();
  348.   prints("USR HST MEMORY CHECKSUM (ROM) DISPLAY -- ATI1");
  349.   cputs("ATI1^M");
  350.   if (waitfor("OK",10))
  351.      return(CONT_OK);
  352.   else
  353.      return(TIME_OUT);
  354.  }
  355.  
  356. ////////////////////////////////////////////////////////////////////////
  357. //                                                                    //
  358. //  Function to perform HST RAM test                                  //
  359. //                                                                    //
  360. ////////////////////////////////////////////////////////////////////////
  361.  
  362. ram_test()
  363. {
  364.   clear_scr();
  365.   prints("USR HST RAM MEMORY TEST -- ATI2");
  366.   cputs("ATI2^M");
  367.   if (waitfor("OK",10))
  368.      return(CONT_OK);
  369.   else
  370.      return(TIME_OUT);
  371.  }
  372.  
  373. ////////////////////////////////////////////////////////////////////////
  374. //                                                                    //
  375. //  Function to display HST RAM settings                              //
  376. //                                                                    //
  377. ////////////////////////////////////////////////////////////////////////
  378.  
  379. current_set()
  380.  {
  381.   clear_scr();
  382.   prints("USR HST CURRENT MODEM SETTINGS -- ATI4");
  383.   cputs("ATI4^M");
  384.   if (not waitfor("HOOK",10)) return(TIME_OUT);
  385.   if (waitfor("OK",10))
  386.      return(CONT_OK);
  387.   else
  388.      return(TIME_OUT);
  389.  }
  390.  
  391. ////////////////////////////////////////////////////////////////////////
  392. //                                                                    //
  393. //  Function to display HST Non-volatile RAM settings                 //
  394. //                                                                    //
  395. ////////////////////////////////////////////////////////////////////////
  396.  
  397. nram_set()
  398.  {
  399.   clear_scr();
  400.   prints("USR HST NON-VOLATILE RAM SETTINGS -- ATI5");
  401.   cputs("ATI5^M");
  402.   if (waitfor("OK",10))
  403.      return(CONT_OK);
  404.   else
  405.      return(TIME_OUT);
  406.  }
  407.  
  408. ////////////////////////////////////////////////////////////////////////
  409. //                                                                    //
  410. //  Function to display HST link diagnostics                          //
  411. //                                                                    //
  412. ////////////////////////////////////////////////////////////////////////
  413.  
  414. link_diag()
  415.  {
  416.   clear_scr();
  417.   prints("USR HST LINK DIAGNOSTICS DISPLAY -- ATI6");
  418.   cputs("ATI6^M");
  419.   if (waitfor("OK",10))
  420.      return(CONT_OK);
  421.   else
  422.      return(TIME_OUT);
  423.  }
  424.  
  425. ////////////////////////////////////////////////////////////////////////
  426. //                                                                    //
  427. //  Function to display/set internal HST TOD clock                    //
  428. //                                                                    //
  429. ////////////////////////////////////////////////////////////////////////
  430.  
  431. set_clock()
  432.  {
  433.   str input[1];
  434.   int ret_val;
  435.  
  436.   ret_val = CONT_OK;
  437.   clear_scr();
  438.   prints("USR HST INTERNAL CLOCK DISPLAY -- ATI3");
  439.   prints("Current modem clock value is:");
  440.   cputs("ATI3^M");
  441.   if (not waitfor("OK",10)) return(TIME_OUT);
  442.   prints(" ");
  443.   prints("Do you wish to set the modem clock (Y/N) ");
  444.   gets(input,1);
  445.   if (input != "Y" and input != "y")
  446.      return(CONT_OK);
  447.   clear_scr();
  448.   prints("USR HST INTERNAL CLOCK SETTING");
  449.   gotoxy(0,2);
  450.   prints("OPTION 1: Synchronize to system clock");
  451.   prints("OPTION 2: Specify your own clock value");
  452.  
  453.   while (1)
  454.      {
  455.       gotoxy(0,5);
  456.       printsc("Type 1 or 2 and (Enter):  ");
  457.       gets(input,1);
  458.       if (input == "1")
  459.          {
  460.           ret_val = sys_clock();
  461.           break;
  462.          }
  463.       else if (input == "2")
  464.          {
  465.           ret_val = usr_clock();
  466.           break;
  467.          }
  468.       else tone(450,50);
  469.      }
  470.  
  471.   gotoxy(0,11);
  472.   prints("Modem Internal clock value is now:");
  473.   cputs("ATI3^M");
  474.   if (waitfor("OK",10))
  475.      return(ret_val);
  476.   else
  477.      return(TIME_OUT);
  478.  }
  479.  
  480. sys_clock()
  481.  {
  482.   str time_str[8];
  483.  
  484.   clear_scr();
  485.   prints("SYNCHRONIZING MODEM CLOCK TO SYSTEM CLOCK");
  486.   gotoxy(0,2);
  487.   printsc("Current system clock is ");
  488.   time(curtime(),time_str);
  489.   prints(time_str);
  490.   cputs("ATK1^M");
  491.   if (not waitfor("OK",10)) return(TIME_OUT);
  492.   prints("^MSetting...");
  493.   cputs("ATI3=");
  494.   cputs(time_str);
  495.   cputs("K1^M");
  496.   if (waitfor("OK",10))
  497.      return(CONT_OK);
  498.   else
  499.      return(TIME_OUT);
  500.  }
  501.  
  502. usr_clock()
  503.  {
  504.   str time_str[8];
  505.  
  506.   clear_scr();
  507.   prints("MANUAL SETTING OF USR HST INTERNAL CLOCK");
  508.   gotoxy(0,2);
  509.   prints("WARNING: The script does not validate the clock value;");
  510.   prints("         an incorrect clock value will return an error.");
  511.   gotoxy(0,6);
  512.   printsc("Type a clock value in HH:MM:SS format and  (Enter): ");
  513.   gets(time_str,8);
  514.   cputs("ATK1^M");
  515.   if (not waitfor("OK",10)) return(TIME_OUT);
  516.   prints("^MSetting...");
  517.   cputs("ATI3=");
  518.   cputs(time_str);
  519.   cputs("K1^M");
  520.   if (waitfor("OK",10))
  521.      return(CONT_OK);
  522.   else
  523.      return(TIME_OUT);
  524.  }
  525.  
  526. ////////////////////////////////////////////////////////////////////////
  527. //                                                                    //
  528. //  Function to set HST S-Registers                                   //
  529. //                                                                    //
  530. ////////////////////////////////////////////////////////////////////////
  531.  
  532. set_sregs()
  533.  {
  534.   str reg_num[2];
  535.   str reg_val[3];
  536.  
  537.   clear_scr();
  538.   prints("SET HST S-REGISTER(S)");
  539.   cputs("ATS$^M");
  540.   if (not waitfor("OK",10)) return(TIME_OUT);
  541.   while (1)
  542.      {
  543.       gotoxy(0,17);
  544.       prints("Enter register you want to set (0-12,16-17,19-28,38) <Enter>=None:   ");
  545.       gotoxy(67,17);
  546.       gets_lead0(reg_num,2);
  547.       if (reg_num == "")
  548.          return(CONT_OK);
  549.       if (reg_num >= "00" and reg_num <= "12" and num_str(reg_num))
  550.          break;
  551.       if (reg_num == "16" or reg_num == "17" and num_str(reg_num))
  552.          break;
  553.       if (reg_num >= "19" and reg_num <= "28" and num_str(reg_num))
  554.          break;
  555.       if (reg_num == "38")
  556.          break;
  557.       tone(400,50);
  558.      }
  559.  
  560.   clear_scr();
  561.   printsc("Current value of register S");
  562.   printsc(reg_num);
  563.   prints(":");
  564.   cputs("ATS");
  565.   cputs(reg_num);
  566.   cputs("?^M");
  567.   if (not waitfor("OK",10)) return(TIME_OUT);
  568.  
  569.   while (1)
  570.      {
  571.       gotoxy(0,7);
  572.       printsc("Type new S");
  573.       printsc(reg_num,);
  574.       prints(" register value or (Enter) to leave as is: ");
  575.       gets_lead0(reg_val,3);
  576.       if (reg_val == "")
  577.          return(CONT_OK);
  578.       if (reg_val >= "0" and reg_val <="255" and num_str(reg_val))
  579.          break;
  580.       tone(400,50);
  581.      }
  582.  
  583.   cputs("ATS");
  584.   cputs(reg_num);
  585.   cputs("=");
  586.   cputs(reg_val);
  587.   cputs("^M");
  588.   if (not waitfor("OK",10)) return(TIME_OUT);
  589.   gotoxy(0,14);
  590.   printsc("New S");
  591.   printsc(reg_num);
  592.   prints(" register value returned by modem is:");
  593.   cputs("ATS");
  594.   cputs(reg_num);
  595.   cputs("?^M");
  596.   if (waitfor("OK",10))
  597.      return(CONT_OK);
  598.   else
  599.      return(TIME_OUT);
  600.  }
  601.  
  602. ////////////////////////////////////////////////////////////////////////
  603. //                                                                    //
  604. //  Function to reset HST to NRAM defaults                            //
  605. //                                                                    //
  606. ////////////////////////////////////////////////////////////////////////
  607.  
  608. set_to_nram()
  609.  {
  610.   str input[1];
  611.   clear_scr();
  612.   prints("Resetting to NRAM defaults may erase changes made to the modem");
  613.   prints("operational parameters or S-Registers if these changes were not");
  614.   prints("copied to NRAM.");
  615.   prints("Do you wish to continue (Y/N):  ");
  616.   gotoxy(30,3);
  617.   gets(input,1);
  618.   if (input != "y" and input != "Y")
  619.      return(CONT_OK);
  620.   cputs("ATZ^M");
  621.   if (waitfor("OK",10))
  622.      return(CONT_OK);
  623.   else
  624.      return(TIME_OUT);
  625.  }
  626.  
  627. ////////////////////////////////////////////////////////////////////////
  628. //                                                                    //
  629. //  Function to display HST Basic command help                        //
  630. //                                                                    //
  631. ////////////////////////////////////////////////////////////////////////
  632.  
  633. basic_help()
  634.  {
  635.   clear_scr();
  636.   cputs("AT$^M");
  637.   if (not waitfor("Hook",10)) return(TIME_OUT);
  638.   if (not waitfor("Hook",10)) return(TIME_OUT);
  639.   if (waitfor("OK",10))
  640.      return(CONT_OK);
  641.   else
  642.      return(TIME_OUT);
  643.  }
  644.  
  645. ////////////////////////////////////////////////////////////////////////
  646. //                                                                    //
  647. //  Function to display HST Basic Command help                        //
  648. //                                                                    //
  649. ////////////////////////////////////////////////////////////////////////
  650.  
  651. ext_help()
  652.  {
  653.   clear_scr();
  654.   cputs("AT&$^M");
  655.   if (waitfor("OK",30))
  656.      return(CONT_OK);
  657.   else
  658.      return(TIME_OUT);
  659.  }
  660.  
  661. ////////////////////////////////////////////////////////////////////////
  662. //                                                                    //
  663. //  Function to display HST Dialling Command help                        //
  664. //                                                                    //
  665. ////////////////////////////////////////////////////////////////////////
  666.  
  667. dial_help()
  668.  {
  669.   clear_scr();
  670.   cputs("ATD$^M");
  671.   if (not waitfor("Hook",30)) return(TIME_OUT);
  672.   if (waitfor("OK",30))
  673.      return(CONT_OK);
  674.   else
  675.      return(TIME_OUT);
  676.  }
  677.  
  678. ////////////////////////////////////////////////////////////////////////
  679. //                                                                    //
  680. //  Function to display HST S-register help                           //
  681. //                                                                    //
  682. ////////////////////////////////////////////////////////////////////////
  683.  
  684. sreg_help()
  685.  {
  686.   clear_scr();
  687.   cputs("ATS$^M");
  688.   if (waitfor("OK",30))
  689.      return(CONT_OK);
  690.   else
  691.      return(TIME_OUT);
  692.  }
  693.  
  694. ////////////////////////////////////////////////////////////////////////
  695. //                                                                    //
  696. //  Function to display HST Switch settings help                      //
  697. //                                                                    //
  698. ////////////////////////////////////////////////////////////////////////
  699.  
  700. switch_help()
  701.  {
  702.   clear_scr();
  703.   prints("HST DIP SWITCH HELP SCREEN");
  704.   prints(" ");
  705.   prints("    ▄  ▄   ");
  706.   prints("   ┌──────┐┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐");
  707.   prints(" UP│██████││ │█│ │█│ │ │█│ │ │█│   FACTORY");
  708.   prints(" DN│      ││█│ │█│ │█│█│ │█│█│ │   SETTINGS");
  709.   prints("   └──────┘└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘");
  710.   prints("      ▀  ▀      1 2 3 4 5 6 7 8 9 10");
  711.   prints(" ");
  712.   prints(" Sw#         Description                 Sw#           Description       ");
  713.   prints(" ------------------------------------------------------------------------");
  714.   prints("  1...Data Terminal Ready Override        6...Carrier Detect Override    ");
  715.   prints("      UP=DTR Normal  DN=DTR always ON         UP=Pin 8     DN=Always ON  ");
  716.   prints("  2...Verbal/Numeric Result Codes         7...Single/Multiple Phone      ");
  717.   prints("      UP=Verbal      DN=Numeric               UP=Single    DN=Multiple   ");
  718.   prints("  3...Result Code Display                 8...Command Set Recognition    ");
  719.   prints("      UP=No Display  DN=Display               UP=Dumb Mode DN=Smart Mode ");
  720.   prints("  4...Command Mode Local Echo             9...Normal Mode Escape Code op.");
  721.   prints("      UP=Echo        DN=No Echo               UP=Hang Up   DN=Keep Connect");
  722.   prints("  5...Auto Answer                        10...Power-on Software Defaults ");
  723.   prints("      UP=AA 1st ring DN=No AA                 UP=Use NRAM  DN=Use ROM    ");
  724.   prints(" ");
  725.   prints("  Quad Switch: Send/Receive UP=Pin2 Xmit/Pin3 Rcv DN=Pin2 Rcv/Pin3 Xmit");
  726.   return(CONT_OK);
  727.  }
  728.  
  729. ////////////////////////////////////////////////////////////////////////
  730. //                                                                    //
  731. //  Function to write to NRAM                                         //
  732. //                                                                    //
  733. ////////////////////////////////////////////////////////////////////////
  734.  
  735. write_nram()
  736.  {
  737.   str input[1];
  738.  
  739.   clear_scr();
  740.   prints("WRITING CHANGES TO NRAM MAY CHANGE YOUR POWER-UP MODEM DEFAULTS.");
  741.   gotoxy(1,3);
  742.   printsc("Do you wish to continue (Y/N):  ");
  743.  
  744.   while (1)
  745.      {
  746.       gotoxy(31,3);
  747.       gets(input,1);
  748.       if (input == "y" or input == "Y")
  749.          break;
  750.       if (input == "n" or input == "N")
  751.          return(CONT_OK);
  752.       tone(400,50);
  753.      }
  754.  
  755.   cputs("AT&W^M");
  756.   if (not waitfor("OK",10)) return(TIME_OUT);
  757.   return(nram_set());
  758.  }
  759.  
  760. ////////////////////////////////////////////////////////////////////////
  761. //                                                                    //
  762. //  Function to perform PC to Modem interface test                    //
  763. //                                                                    //
  764. ////////////////////////////////////////////////////////////////////////
  765.  
  766. interface_test()
  767.  {
  768.   clear_scr();
  769.   prints("PC/MODEM INTERFACE TEST: If the Modem/PC Interface is functional,");
  770.   prints("the modem will respond with 'OK'...");
  771.   delay_scr(50);
  772.   cputs("AT^M");
  773.   if (waitfor("OK",10))
  774.      return(CONT_OK);
  775.   else
  776.      return(TIME_OUT);
  777.  }
  778.  
  779. ////////////////////////////////////////////////////////////////////////
  780. //                                                                    //
  781. //  Function to perform Analog Loopback/Dial Frequency test           //
  782. //                                                                    //
  783. ////////////////////////////////////////////////////////////////////////
  784.  
  785. analog_loop()
  786.  {
  787.   clear_scr();
  788.   prints("ANALOG LOOPBACK SELF-TEST AND DIAL FREQUENCY TEST: The HST will");
  789.   prints("modulate and demodulate its own internal test pattern and return");
  790.   prints("the pattern to the scree. The first step, upon success, will");
  791.   prints("display 'CONNECT 2400'. The second step will display 'NO CARRIER'.");
  792.   cputs("AT&M0S16=5D^M");
  793.   if (not waitfor("CONNECT 2400",20)) return(TIME_OUT);
  794.   prints(" ");
  795.   prints("-- Step 1 OK");
  796.   delay_scr(30);
  797.   cputs("X");
  798.   if (not waitfor("NO CARRIER",20)) return(TIME_OUT);
  799.   prints(" ");
  800.   prints("-- Step 2 OK");
  801.   cputs("AT&M4S16=0^M");
  802.   if (waitfor("OK",20))
  803.      return(CONT_OK);
  804.   else
  805.      return(TIME_OUT);
  806.  }
  807.  
  808. ////////////////////////////////////////////////////////////////////////
  809. //                                                                    //
  810. //  Function to perform Analog Loopback/Answer Frequency test         //
  811. //                                                                    //
  812. ////////////////////////////////////////////////////////////////////////
  813.  
  814. freq_test()
  815.  {
  816.   clear_scr();
  817.   prints("ANALOG LOOPBACK SELF-TEST AND ANSWER FREQUENCY TEST: The HST will");
  818.   prints("modulate and demodulate its own internal test pattern and return");
  819.   prints("the pattern to the scree. The first step, upon success, will");
  820.   prints("display 'CONNECT 2400'. The second step will display 'NO CARRIER'.");
  821.   cputs("AT&M0S16=5A^M");
  822.   if (not waitfor("CONNECT 2400",20)) return(TIME_OUT);
  823.   prints(" ");
  824.   prints("-- Step 1 OK");
  825.   delay_scr(30);
  826.   cputs("X");
  827.   if (not waitfor("NO CARRIER",20)) return(TIME_OUT);
  828.   prints(" ");
  829.   prints("-- Step 2 OK");
  830.   cputs("AT&M4S16=0^M");
  831.   if (waitfor("OK",20))
  832.      return(CONT_OK);
  833.   else
  834.      return(TIME_OUT);
  835.  }
  836.  
  837. ////////////////////////////////////////////////////////////////////////
  838. //                                                                    //
  839. //  Function to reset HST data modes & error control                  //
  840. //                                                                    //
  841. ////////////////////////////////////////////////////////////////////////
  842.  
  843. data_mode()
  844.  {
  845.   clear_scr();
  846.   prints("RESET STANDARD HST DATA MODE.  This function will reset the HST");
  847.   prints("modem error control and data mode defaults for normal operation.");
  848.   prints(" ");
  849.   cputs("AT&M4S16=0^M");
  850.   if (waitfor("OK",20))
  851.      return(CONT_OK);
  852.   else
  853.      return(TIME_OUT);
  854.  }
  855.  
  856. ////////////////////////////////////////////////////////////////////////
  857. //                                                                    //
  858. //  Function to set PCBoard defaults                                  //
  859. //                                                                    //
  860. ////////////////////////////////////////////////////////////////////////
  861.  
  862. pcboard_def(str rom_level)
  863.  {
  864.   str input[1];
  865.  
  866.   clear_scr();
  867.   flushbuf();
  868.   prints("MODEM SWITCH SETTINGS FOR PCBOARD 14.X HOST OPERATIONS");
  869.   prints(" ");
  870.   prints("    ▄  ▄   ");
  871.   prints("   ┌──────┐┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐");
  872.   prints(" UP│██████││█│█│ │ │ │█│█│ │█│█│");
  873.   prints(" DN│      ││ │ │█│█│█│ │ │█│ │ │");
  874.   prints("   └──────┘└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘");
  875.   prints("      ▀  ▀  1 2 3 4 5 6 7 8 9 10");
  876.   prints(" ");
  877.   prints("NOTE: Switch 7 setting may be changed if you are running");
  878.   prints("      a multi-phone operation");
  879.   prints(" ");
  880.   prints("NOTE: Do NOT change the modem's switch settings at this time.");
  881.   prints("      Once the script has erminated and all internal parameters");
  882.   prints("      have been set and written to non-volatile RAM (NRAM),");
  883.   prints("      terminate Telix via the ALT-X command, power off the");
  884.   prints("      HST modem, set the switches to match the diagram above,");
  885.   prints("      and power the modem back on.  The new switch settings");
  886.   prints("      will then go into effect.");
  887.   prints(" ");
  888.   printsc("Press <Enter> to continue with other modem parameters");
  889.   gets(input,1);
  890.   clear_scr();
  891.   prints("This function will set all modem operational parameters and");
  892.   prints("S-Registers to their optimum values for 19200 bps operation");
  893.   prints("when using PCBoard 14.x software.  The settings implemented");
  894.   prints("via this option are consistent with the HST settings used by");
  895.   prints("Clark Development's PCBMODEM program.");
  896.   return(set_def(rom_level,1));
  897.  }
  898.  
  899. telix_def(str rom_level)
  900.  {
  901.   str input[1];
  902.  
  903.   flushbuf();
  904.   clear_scr();
  905.   prints("MODEM SWITCH SETTINGS FOR TELIX 3.11 ORIGINATE OPERATIONS");
  906.   prints(" ");
  907.   prints("    ▄  ▄   ");
  908.   prints("   ┌──────┐┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐");
  909.   prints(" UP│██████││█│█│ │ │ │█│█│ │ │█│");
  910.   prints(" DN│      ││ │ │█│█│█│ │ │█│█│ │");
  911.   prints("   └──────┘└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘");
  912.   prints("      ▀  ▀  1 2 3 4 5 6 7 8 9 10");
  913.   prints(" ");
  914.   prints("NOTE: Do NOT change the modem's switch settings at this time.");
  915.   prints("      Once the script has erminated and all internal parameters");
  916.   prints("      have been set and written to non-volatile RAM (NRAM),");
  917.   prints("      terminate Telix via the ALT-X command, power off the");
  918.   prints("      HST modem, set the switches to match the diagram above,");
  919.   prints("      and power the modem back on.  The new switch settings");
  920.   prints("      will then go into effect.");
  921.   prints(" ");
  922.   printsc("Press <Enter> to continue with other modem parameters");
  923.   gets(input,1);
  924.   clear_scr();
  925.   prints("This function will set all modem operational parameters and");
  926.   prints("S-Registers to their optimum values for 19200 bps operation");
  927.   prints("when using Telix 3.11 in originate mode.");
  928.   return(set_def(rom_level,0));
  929.  }
  930.  
  931. set_def(str rom_level, int do_pcbdef)
  932.  {
  933.   str input[1];
  934.   int xpos, ypos;
  935.  
  936.   prints(" ");
  937.   prints("You May chose the 'FAST' method which will set all parameters");
  938.   prints("at once without any accompanying display, or the 'SLOW' method");
  939.   prints("which walks you throught the process one parameter at a time.");
  940.   prints("The SLOW method may take a couple minutes to complete.");
  941.   prints(" ");
  942.   printsc("Type 'F' for FAST method, 'S' for SLOW, <Enter>=cancel: ");
  943.   xpos = getx();
  944.   ypos = gety();
  945.   while (1)
  946.      {
  947.       gotoxy(xpos,ypos);
  948.       gets(input,1);
  949.       if (input == "")
  950.          return(CONT_OK);
  951.       else if (input == "f" or input == "F")
  952.                {
  953.                 if (do_pcbdef)
  954.                    return(fast_set_pcb(rom_level));
  955.                 else
  956.                    return(fast_set_telix(rom_level));
  957.                }
  958.       else if (input == "s" or input == "S")
  959.               return(slow_set(rom_level,do_pcbdef));
  960.       else
  961.           tone(400,50);
  962.      }
  963.  }
  964.  
  965. slow_set(str rom_level, int do_pcbdef)
  966.  {
  967.   clear_scr();
  968.   prints("SET TRANSMITTER ENABLED : ATC1");
  969.   cputs("ATC1^M");
  970.   if (not waitfor("OK",10)) return(TIME_OUT);
  971.   delay_scr(20);
  972.   clear_scr();
  973.   prints("SET COMMAND MODE ECHO OFF: ATE0");
  974.   cputs("ATE0^M");
  975.   if (not waitfor("OK",10)) return(TIME_OUT);
  976.   delay_scr(20);
  977.   clear_scr();
  978.   prints("SET LOCAL ECHO OFF AFTER CONNECT: ATF1");
  979.   cputs("ATF1^M");
  980.   if (not waitfor("OK",10)) return(TIME_OUT);
  981.   delay_scr(20);
  982.   clear_scr();
  983.   if (do_pcbdef)
  984.      {
  985.       prints("DISABLE SPEAKER: ATM0");
  986.       cputs("ATM0^M");
  987.       if (not waitfor("OK",10)) return(TIME_OUT);
  988.       delay_scr(20);
  989.      }
  990.   else
  991.      {
  992.       prints("SET SPEAKER ON UNTIL CARRIER ESTABLISHED: ATM1");
  993.       cputs("ATM1^M");
  994.       if (not waitfor("OK",10)) return(TIME_OUT);
  995.       delay_scr(20);
  996.      }
  997.   clear_scr();
  998.   prints("SET QUIET MODE OFF-RESULT CODES DISPLAYED: ATQ0");
  999.   cputs("ATQ0^M");
  1000.   if (not waitfor("OK",10)) return(TIME_OUT);
  1001.   delay_scr(20);
  1002.   clear_scr();
  1003.   prints("SET RESULTS TO VERBAL MODE: ATV1");
  1004.   cputs("ATV1^M");
  1005.   if (not waitfor("OK",10)) return(TIME_OUT);
  1006.   delay_scr(20);
  1007.   clear_scr();
  1008.   prints("SET EXTENDED RESULT CODE OPTION: ATX6");
  1009.   cputs("ATX6^M");
  1010.   if (not waitfor("OK",10)) return(TIME_OUT);
  1011.   delay_scr(20);
  1012.   clear_scr();
  1013.   prints("SET U.S. ANSWER SEQUENCE DEFAULT: ATB1");
  1014.   cputs("ATB1^M");
  1015.   if (not waitfor("OK",10)) return(TIME_OUT);
  1016.   delay_scr(20);
  1017.   clear_scr();
  1018.   prints("EXTENDED FUNCTION-ENABLE ARQ RESULT CODE: AT&A1");
  1019.   cputs("AT&A1^M");
  1020.   if (not waitfor("OK",10)) return(TIME_OUT);
  1021.   delay_scr(20);
  1022.   clear_scr();
  1023.   prints("EXTENDED FUNCTION-FIX DTE RATE: AT&B1");
  1024.   cputs("AT&B1^M");
  1025.   if (not waitfor("OK",10)) return(TIME_OUT);
  1026.   delay_scr(20);
  1027.   clear_scr();
  1028.   prints("EXTENDED FUNCTION-XMIT DATA CTS HARDWARE FLOW CONTROL: AT&H1");
  1029.   cputs("AT&H1^M");
  1030.   if (not waitfor("OK",10)) return(TIME_OUT);
  1031.   delay_scr(20);
  1032.   clear_scr();
  1033.   prints("EXTENDED FUNCTION-RCV DATA FLOW CONTROL DISABLED: AT&I0");
  1034.   cputs("AT&I0^M");
  1035.   if (not waitfor("OK",10)) return(TIME_OUT);
  1036.   delay_scr(20);
  1037.   if (rom_level >= "964" or rom_level == "1440")
  1038.      {
  1039.       clear_scr();
  1040.       prints("EXTENDED FUNCTION (964)-DISABLE DATA COMPRESSION: AT&K0");
  1041.       cputs("AT&K0^M");
  1042.       if (not waitfor("OK",10)) return(TIME_OUT);
  1043.       delay_scr(20);
  1044.      }
  1045.   clear_scr();
  1046.   prints("EXTENDED FUNCTION-ERROR CONTROL MODE NORMAL/ARQ: AT&M4");
  1047.   cputs("AT&M4^M");
  1048.   if (not waitfor("OK",10)) return(TIME_OUT);
  1049.   delay_scr(20);
  1050.   clear_scr();
  1051.   prints("EXTENDED FUNCTION-DATA RATE SET TO NORMAL LINK OPERATIONS: AT&N0");
  1052.   cputs("AT&N0^M");
  1053.   if (not waitfor("OK",10)) return(TIME_OUT);
  1054.   delay_scr(20);
  1055.   clear_scr();
  1056.   prints("EXTENDED FUNCTION-SET PULSE DIAL MAKE/BREAK RATIO TO U.S.: AT&P0");
  1057.   cputs("AT&P0^M");
  1058.   if (not waitfor("OK",10)) return(TIME_OUT);
  1059.   delay_scr(20);
  1060.   clear_scr();
  1061.   prints("EXTENDED FUNCTION-RCV DATA FLOW CONTROL->PASS ON RTS HIGH: AT&R2");
  1062.   cputs("AT&R2^M");
  1063.   if (not waitfor("OK",10)) return(TIME_OUT);
  1064.   delay_scr(20);
  1065.   clear_scr();
  1066.   prints("EXTENDED FUNCTION-MODEM CONTROLS DATA SET READY LINE: AT&S1");
  1067.   cputs("AT&S1^M");
  1068.   if (not waitfor("OK",10)) return(TIME_OUT);
  1069.   delay_scr(20);
  1070.   clear_scr();
  1071.   prints("EXTENDED FUNCTION-SEND DESTRUCTIVE, EXPEDITED BREAKS: AT&Y1");
  1072.   cputs("AT&Y1^M");
  1073.   if (not waitfor("OK",10)) return(TIME_OUT);
  1074.   delay_scr(20);
  1075.   clear_scr();
  1076.   prints("S-REGISTER- DISABLE AUTO ANSWER: ATS0=0");
  1077.   cputs("ATS0=0^M");
  1078.   if (not waitfor("OK",10)) return(TIME_OUT);
  1079.   delay_scr(20);
  1080.   clear_scr();
  1081.   prints("S-REGISTER-RESET INCOMING RING COUNT TO ZERO: ATS1=0");
  1082.   cputs("ATS1=0^M");
  1083.   if (not waitfor("OK",10)) return(TIME_OUT);
  1084.   delay_scr(20);
  1085.   clear_scr();
  1086.   if (do_pcbdef)
  1087.      {
  1088.       prints("S-REGISTER- SET ASCII ESCAPE CODE DEFAULT TO X'FF': ATS2=255");
  1089.       cputs("ATS2=255^M");
  1090.       if (not waitfor("OK",10)) return(TIME_OUT);
  1091.       delay_scr(20);
  1092.      }
  1093.   else
  1094.      {
  1095.       prints("S-REGISTER- SET ASCII ESCAPE CODE DEFAULT TO '+': ATS2=43");
  1096.       cputs("ATS2=43^M");
  1097.       if (not waitfor("OK",10)) return(TIME_OUT);
  1098.       delay_scr(20);
  1099.      }
  1100.   clear_scr();
  1101.   prints("S-REGISTER- SET ASCII CARRIAGE RETURN TO 13: ATS3=13");
  1102.   cputs("ATS3=13^M");
  1103.   if (not waitfor("OK",10)) return(TIME_OUT);
  1104.   delay_scr(20);
  1105.   clear_scr();
  1106.   prints("S-REGISTER- SET ASCII LINE FEED TO 10: ATS4=10");
  1107.   cputs("ATS4=10^M");
  1108.   if (not waitfor("OK",10)) return(TIME_OUT);
  1109.   delay_scr(20);
  1110.   clear_scr();
  1111.   prints("S-REGISTER- SET ASCII BACKSPACE TO 8: ATS5=8");
  1112.   cputs("ATS5=8^M");
  1113.   if (not waitfor("OK",10)) return(TIME_OUT);
  1114.   delay_scr(20);
  1115.   clear_scr();
  1116.   prints("S-REGISTER- SET #SECONDS MODEM WAITS BEFORE DIALING T0 2: ATS6=2");
  1117.   cputs("ATS6=2^M");
  1118.   if (not waitfor("OK",10)) return(TIME_OUT);
  1119.   delay_scr(20);
  1120.   clear_scr();
  1121.   prints("S-REGISTER- SET #SECONDS MODEM WAITS FOR CARRIER TO 30: ATS7=30");
  1122.   cputs("ATS7=30^M");
  1123.   if (not waitfor("OK",10)) return(TIME_OUT);
  1124.   delay_scr(20);
  1125.   clear_scr();
  1126.   prints("S-REGISTER- SET DURATION OF PAUSE (,) TO 2/10TH SECOND: ATS8=2");
  1127.   cputs("ATS8=2^M");
  1128.   if (not waitfor("OK",10)) return(TIME_OUT);
  1129.   delay_scr(20);
  1130.   clear_scr();
  1131.   prints("S-REGISTER- REQUIRED DURATION OF REMOTE CARRIER 6/10TH SEC: ATS9=6");
  1132.   cputs("ATS9=6^M");
  1133.   if (not waitfor("OK",10)) return(TIME_OUT);
  1134.   delay_scr(20);
  1135.   clear_scr();
  1136.   prints("S-REGISTER- HANG UP 5 SEC AFTER LOSS OF CARRIER: ATS10=50");
  1137.   cputs("ATS10=50^M");
  1138.   if (not waitfor("OK",10)) return(TIME_OUT);
  1139.   delay_scr(20);
  1140.   clear_scr();
  1141.   prints("S-REGISTER- TOUCH-TONE DURATION AND SPACING IS 70 MILLISECS: ATS11=70");
  1142.   cputs("ATS11=70^M");
  1143.   if (not waitfor("OK",10)) return(TIME_OUT);
  1144.   delay_scr(20);
  1145.   clear_scr();
  1146.   prints("S-REGISTER- ESCAPE CODE SEQUENCE GUARD TIME IS 50 MICSSECS: ATS12=50");
  1147.   cputs("ATS12=50^M");
  1148.   if (not waitfor("OK",10)) return(TIME_OUT);
  1149.   delay_scr(20);
  1150.   clear_scr();
  1151.   prints("S-REGISTER- SET BIT-MAPPED REGISTER TO ZERO: ATS13=0");
  1152.   cputs("ATS13=0^M");
  1153.   if (not waitfor("OK",10)) return(TIME_OUT);
  1154.   delay_scr(20);
  1155.   clear_scr();
  1156.   prints("S-REGISTER- SET SELF-TEST REGISTER TO DATA MODE (NO TEST): ATS16=0");
  1157.   cputs("ATS16=0^M");
  1158.   if (not waitfor("OK",10)) return(TIME_OUT);
  1159.   delay_scr(20);
  1160.   clear_scr();
  1161.   prints("S-REGISTER- SET ARQ LINK DISCONNECT REASON REGISTER TO ZERO: ATS17=0");
  1162.   cputs("ATS17=0^M");
  1163.   if (not waitfor("OK",10)) return(TIME_OUT);
  1164.   delay_scr(20);
  1165.   clear_scr();
  1166.   if (do_pcbdef)
  1167.      {
  1168.       prints("S-REGISTER- SET INACTIVITY TIMER TO FIVE MINUTE AUTO HANGUP: ATS19=5");
  1169.       cputs("ATS19=5^M");
  1170.       if (not waitfor("OK",10)) return(TIME_OUT);
  1171.       delay_scr(20);
  1172.      }
  1173.   else
  1174.      {
  1175.       prints("S-REGISTER- SET INACTIVITY TIMER TO ZERO (NO AUTO HANGUP): ATS19=0");
  1176.       cputs("ATS19=0^M");
  1177.       if (not waitfor("OK",10)) return(TIME_OUT);
  1178.       delay_scr(20);
  1179.      }
  1180.   clear_scr();
  1181.   prints("S-REGISTER- SET NO CARRIER REASON CODE REGISTER TO ZERO: ATS20=0");
  1182.   cputs("ATS20=0^M");
  1183.   if (not waitfor("OK",10)) return(TIME_OUT);
  1184.   delay_scr(20);
  1185.   clear_scr();
  1186.   prints("S-REGISTER- SET LENGTH OF BREAKS TO 100 MILLISECONDS: ATS21=10");
  1187.   cputs("ATS21=10^M");
  1188.   if (not waitfor("OK",10)) return(TIME_OUT);
  1189.   delay_scr(20);
  1190.   clear_scr();
  1191.   prints("S-REGISTER- SET ASCII VALUE OF XON TO 17: ATS22=17");
  1192.   cputs("ATS22=17^M");
  1193.   if (not waitfor("OK",10)) return(TIME_OUT);
  1194.   delay_scr(20);
  1195.   clear_scr();
  1196.   prints("S-REGISTER- SET ASCII VALUE OF XOFF TO 19: ATS23=19");
  1197.   cputs("ATS23=19^M");
  1198.   if (not waitfor("OK",10)) return(TIME_OUT);
  1199.   delay_scr(20);
  1200.   return(write_parms());
  1201.  }
  1202.  
  1203. fast_set_telix(str rom_level)
  1204.  {
  1205.   clear_scr();
  1206.   prints("SENDING TELIX SETUP PARAMETERS TO HST MODEM.......");
  1207.   prints(" ");
  1208.   cputs("AT C1 E0 F1 M1 Q0 V1 X6 B1^M");
  1209.   if (not waitfor("OK",10)) return(TIME_OUT);
  1210.   delay_scr(20);
  1211.   cputs("AT &A1 &B1 &G0 &H1 &I0 ^M");
  1212.   if (not waitfor("OK",10)) return(TIME_OUT);
  1213.   delay_scr(20);
  1214.   if (rom_level >= "964" or rom_level == "1440")
  1215.      cputs("AT &K0");
  1216.   else
  1217.      cputs("AT");
  1218.   cputs(" &M4 &N0 &P0 &R2 &S1 &Y1^M");
  1219.   if (not waitfor("OK",10)) return(TIME_OUT);
  1220.   delay_scr(20);
  1221.   cputs("AT S0=0 S1=0 S2=43 S3=13 ^M");
  1222.   if (not waitfor("OK",10)) return(TIME_OUT);
  1223.   delay_scr(20);
  1224.   cputs("AT S4=10 S5=8 S6=2 S7=60 S8=2 ^M");
  1225.   if (not waitfor("OK",10)) return(TIME_OUT);
  1226.   delay_scr(20);
  1227.   cputs("AT S9=6 S10=7 S11=70 S12=50 ^M");
  1228.   if (not waitfor("OK",10)) return(TIME_OUT);
  1229.   delay_scr(20);
  1230.   cputs("AT S13=0 S16=0 S17=0 ^M");
  1231.   if (not waitfor("OK",10)) return(TIME_OUT);
  1232.   delay_scr(20);
  1233.   cputs("AT S19=0 S20=0 S21=10 S22=17 S23=19^M");
  1234.   if (not waitfor("OK",10)) return(TIME_OUT);
  1235.   delay_scr(20);
  1236.   return(write_parms());
  1237.  }
  1238.  
  1239. fast_set_pcb(str rom_level)
  1240.  {
  1241.   clear_scr();
  1242.   prints("SENDING PCBOARD SETUP PARAMETERS TO HST MODEM.......");
  1243.   prints(" ");
  1244.   cputs("AT C1 E0 F1 M0 Q0 V1 X6 B1^M");
  1245.   if (not waitfor("OK",10)) return(TIME_OUT);
  1246.   delay_scr(20);
  1247.   cputs("AT &A1 &B1 &G0 &H1 &I0 &M4 ^M");
  1248.   if (not waitfor("OK",10)) return(TIME_OUT);
  1249.   delay_scr(20);
  1250.   if (rom_level >= "964" or rom_level == "1440")
  1251.      cputs("AT &K0");
  1252.   else
  1253.      cputs("AT");
  1254.   cputs(" &N0 &P0 &R2 &S1 &Y1^M");
  1255.   if (not waitfor("OK",10)) return(TIME_OUT);
  1256.   delay_scr(20);
  1257.   cputs("AT S0=0 S1=1 S2=255 S3=13^M");
  1258.   if (not waitfor("OK",10)) return(TIME_OUT);
  1259.   delay_scr(20);
  1260.   cputs("AT S4=10 S5=8 S6=2 S7=30 S8=2^M");
  1261.   if (not waitfor("OK",10)) return(TIME_OUT);
  1262.   delay_scr(20);
  1263.   cputs("AT S9=6 S10=7 S11=70 S12=50^M");
  1264.   if (not waitfor("OK",10)) return(TIME_OUT);
  1265.   delay_scr(20);
  1266.   cputs("AT S13=0 S16=0 S17=0^M");
  1267.   if (not waitfor("OK",10)) return(TIME_OUT);
  1268.   delay_scr(20);
  1269.   cputs("AT S19=5 S20=0 S21=10 S22=17 S23=19^M");
  1270.   if (not waitfor("OK",10)) return(TIME_OUT);
  1271.   delay_scr(20);
  1272.   return(write_parms());
  1273.  }
  1274.  
  1275. write_parms()
  1276.  {
  1277.   str input[1];
  1278.  
  1279.   clear_scr();
  1280.   prints("ALL DEFAULTS HAVE BEEN SET....");
  1281.   prints(" ");
  1282.   prints("Y to write defaults to NRAM");
  1283.   prints("N to cancel");
  1284.   gotoxy(1,5);
  1285.   printsc("Type Y/N and (Enter)   ");
  1286.   while (1)
  1287.      {
  1288.       gotoxy(22,5);
  1289.       gets(input,1);
  1290.       if (input == "n" or input == "N")
  1291.          return(CONT_OK);
  1292.       else if (input == "y" or input == "Y")
  1293.               break;
  1294.       else
  1295.          tone(400,50);
  1296.      }
  1297.  
  1298.   cputs("AT&W^M");
  1299.   if (not waitfor("OK",10)) return(TIME_OUT);
  1300.   clear_scr();
  1301.   prints("If you changed switch settings 2,3,4,5 OR 9, a hardware reset");
  1302.   prints("must be performed for the new switch settings to go into effect.");
  1303.   prints("(hardware reset can be done now or later via power-off/power-on).");
  1304.   prints(" ");
  1305.   printsc("Do you wish a hardware reset to be performed now (Y/N):   ");
  1306.  
  1307.   while (1)
  1308.      {
  1309.       gotoxy(56,4);
  1310.       gets(input,1);
  1311.       if (input == "n" or input == "N")
  1312.          return(CONT_OK);
  1313.       else if (input == "y" or input == "Y")
  1314.               break;
  1315.       else
  1316.          tone(400,50);
  1317.      }
  1318.  
  1319.   clear_scr();
  1320.   prints("RESETTING HARDWARE TO NRAM AND NEW SWITCH SETTINGS");
  1321.   cputs("ATZ^M");
  1322.   if (waitfor("OK",10))
  1323.      return(CONT_OK);
  1324.   else
  1325.      return(TIME_OUT);
  1326.  }
  1327.  
  1328. ////////////////////////////////////////////////////////////////////////
  1329. //                                                                    //
  1330. //  Function to disable MNP level 5 data compression                  //
  1331. //                                                                    //
  1332. ////////////////////////////////////////////////////////////////////////
  1333.  
  1334. disable_comp()
  1335.  {
  1336.   clear_scr();
  1337.   printsc("DISABLE MNP LEVEL 5 DATA COMPRESSION - AT&K0");
  1338.   cputs("AT&K0^M");
  1339.   if (waitfor("OK",10))
  1340.      return(CONT_OK);
  1341.   else
  1342.      return(TIME_OUT);
  1343.  }
  1344.  
  1345. ////////////////////////////////////////////////////////////////////////
  1346. //                                                                    //
  1347. //  Function to auto enable/disable MNP level 5 data compression      //
  1348. //                                                                    //
  1349. ////////////////////////////////////////////////////////////////////////
  1350.  
  1351. auto_comp()
  1352.  {
  1353.   clear_scr();
  1354.   printsc("AUTO ENABLE/DISABLE MNP LEVEL 5 DATA COMPRESSION - AT&K1");
  1355.   cputs("AT&K1^M");
  1356.   if (waitfor("OK",10))
  1357.      return(CONT_OK);
  1358.   else
  1359.      return(TIME_OUT);
  1360.  }
  1361.  
  1362. ////////////////////////////////////////////////////////////////////////
  1363. //                                                                    //
  1364. //  Function to enable MNP level 5 data compression                   //
  1365. //                                                                    //
  1366. ////////////////////////////////////////////////////////////////////////
  1367.  
  1368. enable_comp()
  1369.  {
  1370.   clear_scr();
  1371.   printsc("FORCE ENABLE MNP LEVEL 5 DATA COMPRESSION - AT&K2");
  1372.   cputs("AT&K2^M");
  1373.   if (waitfor("OK",10))
  1374.      return(CONT_OK);
  1375.   else
  1376.      return(TIME_OUT);
  1377.  }
  1378.  
  1379. ////////////////////////////////////////////////////////////////////////
  1380. //                                                                    //
  1381. //  Function displays Modem Configuration Inquiry screen              //
  1382. //                                                                    //
  1383. ////////////////////////////////////////////////////////////////////////
  1384.  
  1385. modem_inq()
  1386.  {
  1387.   clear_scr();
  1388.   printsc("MODEM CONFIGURATION INQUIRY SCREEN - ATI7");
  1389.   printsc(" ");
  1390.   cputs("ATI7^M");
  1391.   if (waitfor("OK",10))
  1392.      return(CONT_OK);
  1393.   else
  1394.      return(TIME_OUT);
  1395.  }
  1396.  
  1397. ////////////////////////////////////////////////////////////////////////
  1398. //                                                                    //
  1399. //  Function sets the S13 register                                    //
  1400. //                                                                    //
  1401. ////////////////////////////////////////////////////////////////////////
  1402.  
  1403. set_s13reg()
  1404.  {
  1405.   str input[1];
  1406.   str new_value[3];
  1407.  
  1408.   clear_scr();
  1409.   prints("ROM LEVEL 964+ - S-REGISTER 13 SETTINGS");
  1410.   prints("S-register 13 controls certain little used features of the HST Modem");
  1411.   prints("Each bit in the register controls a modem feature or function,");
  1412.   prints("as shown below. The corresponding bit value precedes each feature");
  1413.   prints("description. To select a feature, add its bit value to the total");
  1414.   prints("and store the total in the register.  The max S13 value is 223,");
  1415.   prints("(1+2+4+8+16+64+128)");
  1416.   prints(" ");
  1417.   prints("Bit value   1: Reset on dropping of DTR");
  1418.   prints("Bit value   2: Auto-answer in originate mode");
  1419.   prints("Bit value   4: Disable result code pause");
  1420.   prints("Bit value   8: DS0 on DTR low-to-high");
  1421.   prints("Bit Value  16: DS0 on power-up & ATZ");
  1422.   prints("Bit Value  32: reserved");
  1423.   prints("Bit Value  64: Disable MNP level 3");
  1424.   prints("Bit Value 128: Watchdog hardware reset");
  1425.   prints(" ");
  1426.   prints("NOTE: Please refer to your HST manual for aditional information");
  1427.   prints("      on the above features and S13-register settings");
  1428.   prints(" ");
  1429.   printsc("Do you wish to change the value of S-register 13 (Y/N)? ");
  1430.   gets(input,1);
  1431.   if (input != "y" and input != "Y")
  1432.      return(CONT_OK);
  1433.   gotoxy(0,21);
  1434.   prints("New total bit value for S-register 15 (0-223) or <Enter> to cancel:    ");
  1435.   while (1)
  1436.      {
  1437.       gotoxy(68,21);
  1438.       gets_lead0(new_value,3);
  1439.       if (new_value == "")
  1440.          return(CONT_OK);
  1441.       else if (new_value >= "0" and new_value <= "223" and num_str(new_value))
  1442.               break;
  1443.       tone(400,50);
  1444.      }
  1445.   clear_scr();
  1446.   printsc("SETTING NEW S-REGISTER 13 VALUE - ATS13=");
  1447.   prints(new_value);
  1448.   cputs("ATS13=");
  1449.   cputs(new_value);
  1450.   cputs("^M");
  1451.   if (waitfor("OK",10))
  1452.      return(CONT_OK);
  1453.   else
  1454.      return(TIME_OUT);
  1455.  }
  1456.  
  1457. ////////////////////////////////////////////////////////////////////////
  1458. //                                                                    //
  1459. //  Function sets the S15 register                                    //
  1460. //                                                                    //
  1461. ////////////////////////////////////////////////////////////////////////
  1462.  
  1463. set_s15reg()
  1464.  {
  1465.   str input[1];
  1466.   str new_value[3];
  1467.  
  1468.   clear_scr();
  1469.   prints("ROM LEVEL 964+ - S-REGISTER 15 SETTINGS");
  1470.   prints("S-register 15 controls many of the level 964 ROM features. Each bit");
  1471.   prints("in the register controls a modem feature or function, as shown below");
  1472.   prints("The corresponding bit value precedes each feature description.");
  1473.   prints("To select a feature, add its bit value to the total and store the");
  1474.   prints("the total in the register.  The max S15 value is 255 (128+64+16+8+2+1).");
  1475.   prints(" ");
  1476.   prints("Bit value   1: disable extra high-frequency equalization");
  1477.   prints("Bit value   2: disable 7200/4800bps online fallback");
  1478.   prints("Bit value   4: force 300bps back channel");
  1479.   prints("Bit value   8: use 128-byte buffer in non-MNP operation");
  1480.   prints("Bit Value  16: disable MNP Level 4");
  1481.   prints("Bit Value  32: set DEL as backspace key");
  1482.   prints("Bit Value  64: Unusual MNP incompatibility");
  1483.   prints("Bit Value 128: Interbridge network compatibility");
  1484.   prints(" ");
  1485.   prints("NOTE: Please refer to your HST manual for aditional information");
  1486.   prints("      on the above features and S15-register settings");
  1487.   prints(" ");
  1488.   printsc("Do you wish to change the value of S-register 15 (Y/N)? ");
  1489.   gets(input,1);
  1490.   if (input != "y" and input != "Y")
  1491.      return(CONT_OK);
  1492.   gotoxy(0,21);
  1493.   prints("New total bit value for S-register 15 (0-255) or <Enter> to cancel:  ");
  1494.   while (1)
  1495.      {
  1496.       gotoxy(68,21);
  1497.       gets_lead0(new_value,3);
  1498.       if (new_value == "")
  1499.          return(CONT_OK);
  1500.       else if (new_value >= "0" and new_value <= "255" and num_str(new_value))
  1501.               break;
  1502.       tone(400,50);
  1503.      }
  1504.   clear_scr();
  1505.   printsc("SETTING NEW S-REGISTER 15 VALUE - ATS15=");
  1506.   prints(new_value);
  1507.   cputs("ATS15=");
  1508.   cputs(new_value);
  1509.   cputs("^M");
  1510.   if (waitfor("OK",10))
  1511.      return(CONT_OK);
  1512.   else
  1513.      return(TIME_OUT);
  1514.  }
  1515.  
  1516. ////////////////////////////////////////////////////////////////////////
  1517. //                                                                    //
  1518. //  Function to list/set Modem link rate settings                     //
  1519. //                                                                    //
  1520. ////////////////////////////////////////////////////////////////////////
  1521.  
  1522. set_rate()
  1523.  {
  1524.   str input[1];
  1525.   str new_rate[4];
  1526.  
  1527.   clear_scr();
  1528.   prints("MODEM LINK RATE SETTINGS - AT&Nx");
  1529.   prints(" ");
  1530.   prints("This command allows you to set the modem LINK rate (the data rate ");
  1531.   prints("on the modem-modem connection) to a FIXED value between 300bps and");
  1532.   prints("14,400bps.  Normally, the default (&N0) allows the modem to adapt its");
  1533.   prints("rate to that of the receiving modem.  Forcing a fixed link rate  ");
  1534.   prints("will cause your modem to disconnect if the other modem is not set ");
  1535.   prints("at the same rate.  Unless you have a need for this feature, use of ");
  1536.   prints("the default value is recommended.");
  1537.   prints(" ");
  1538.   prints("Do you want to change the modem's link rate setting (Y/N):   ");
  1539.   gotoxy(59,10);
  1540.   gets(input,1);
  1541.   if (input != "y" and input != "Y")
  1542.      return(CONT_OK);
  1543.   clear_scr();
  1544.   prints("CHANGE LINK RATE SETTING - AT&Nx");
  1545.   prints(" ");
  1546.   prints("0=set link rate to DEFAULT - AUTO SPEED DETECT");
  1547.   prints("1=set link rate to 300bps");
  1548.   prints("2=set link rate to 1200bps");
  1549.   prints("3=set link rate to 2400bps");
  1550.   prints("4=set link rate to 4800bps");
  1551.   prints("5=set link rate to 7200bps");
  1552.   prints("6=set link rate to 9600bps");
  1553.   prints("7=set link rate to 12K bps");
  1554.   prints("8=set link rate to 14.4K bps");
  1555.   gotoxy(0,12);
  1556.   prints("Enter new link rate value (0-8) or <Enter> to cancel:   ");
  1557.   while (1)
  1558.      {
  1559.       gotoxy(53,10);
  1560.       gets(input,1);
  1561.       if (input == "")
  1562.          return(CONT_OK);
  1563.       else if (input == "0")
  1564.               {
  1565.                new_rate = "Auto";
  1566.                break;
  1567.               }
  1568.       else if (input == "1")
  1569.               {
  1570.                new_rate = "300";
  1571.                break;
  1572.               }
  1573.       else if (input == "2")
  1574.               {
  1575.                new_rate = "1200";
  1576.                break;
  1577.               }
  1578.       else if (input == "3")
  1579.               {
  1580.                new_rate = "2400";
  1581.                break;
  1582.               }
  1583.       else if (input == "4")
  1584.               {
  1585.                new_rate = "4800";
  1586.                break;
  1587.               }
  1588.       else if (input == "5")
  1589.               {
  1590.                new_rate = "7200";
  1591.                break;
  1592.               }
  1593.       else if (input == "6")
  1594.               {
  1595.                new_rate = "9600";
  1596.                break;
  1597.               }
  1598.       else if (input == "7")
  1599.               {
  1600.                new_rate = "12000";
  1601.                break;
  1602.               }
  1603.       else if (input == "8")
  1604.               {
  1605.                new_rate = "14400";
  1606.                break;
  1607.               }
  1608.       tone(400,50);
  1609.      }
  1610.  
  1611.   clear_scr();
  1612.   printsc("SETTING NEW LINK RATE TO ");
  1613.   printsc(new_rate);
  1614.   printsc(" bps: AT&N");
  1615.   prints(input);
  1616.   cputs("AT&N");
  1617.   cputs(input);
  1618.   cputs("^M");
  1619.   if (waitfor("OK",10))
  1620.      return(CONT_OK);
  1621.   else
  1622.      return(TIME_OUT);
  1623.  }
  1624.  
  1625. ////////////////////////////////////////////////////////////////////////
  1626. //                                                                    //
  1627. //  Function to display/set RAM-stored phone numbers                  //
  1628. //                                                                    //
  1629. ////////////////////////////////////////////////////////////////////////
  1630.  
  1631. disp_phone()
  1632.  {
  1633.   str num0[36];
  1634.   str num1[36];
  1635.   str num2[36];
  1636.   str num3[36];
  1637.   str change_num[1];
  1638.   str new_num[36];
  1639.  
  1640.   while (1)
  1641.      {
  1642.       num0 = "";
  1643.       num1 = "";
  1644.       num2 = "";
  1645.       num3 = "";
  1646.       clear_scr();
  1647.       printsc("RAM-STORED NUMBERS (BLANK INDICATES NO NUMBER STORED)");
  1648.       gotoxy(0,2);
  1649.       flushbuf();
  1650.       cputs("AT&Z0?^M");
  1651.       get_num(num0);
  1652.       flushbuf();
  1653.       cputs("AT&Z1?^M");
  1654.       get_num(num1);
  1655.       flushbuf();
  1656.       cputs("AT&Z2?^M");
  1657.       get_num(num2);
  1658.       flushbuf();
  1659.       cputs("AT&Z3?^M");
  1660.       get_num(num3);
  1661.  
  1662.       printsc("NUMBER 0: ");
  1663.       prints(num0);
  1664.       printsc("NUMBER 1: ");
  1665.       prints(num1);
  1666.       printsc("NUMBER 2: ");
  1667.       prints(num2);
  1668.       printsc("NUMBER 3: ");
  1669.       prints(num3);
  1670.  
  1671.       gotoxy(0,10);
  1672.       printsc("Number to change (0-3) or (Enter) to leave unchanged:   ");
  1673.       while (1)
  1674.          {
  1675.           gotoxy(54,10);
  1676.           gets(change_num,1);
  1677.           if (change_num == "")
  1678.              return(CONT_OK);
  1679.           else if (change_num >= "0" and change_num <= "3")
  1680.                   break;
  1681.           tone(400,50);
  1682.          }
  1683.  
  1684.       gotoxy(0,12);
  1685.       printsc("Enter new number (36 pos.max.) ____________________________________");
  1686.       gotoxy(31,12);
  1687.       gets(new_num,36);
  1688.       cputs("AT&Z");
  1689.       cputs(change_num);
  1690.       cputs("=");
  1691.       cputs(new_num);
  1692.       cputs("^M");
  1693.       gotoxy(0,16);
  1694.       printsc("New number has been stored in RAM at position ");
  1695.       prints(change_num);
  1696.       delay_scr(20);
  1697.      }
  1698.  }
  1699.  
  1700. get_num(str number)
  1701.  {
  1702.   int i, chr;
  1703.   str temp[5];
  1704.  
  1705.   chr = cgetct(100);
  1706.   if (chr != 13)
  1707.      prints("ERROR: Expecting CR");
  1708.   chr = cgetct(100);
  1709.   if (chr != 10)
  1710.      prints("ERROR: Expecting LF");
  1711.  
  1712.   for (i = 0; i < 36; ++i)
  1713.       {
  1714.        chr = cgetct(100);
  1715.        if (chr == 13 or chr == -1)
  1716.           {
  1717.            delay(10);
  1718.            return();
  1719.           }
  1720.        else
  1721.           setchr(number,i,chr);
  1722.       }
  1723.  }
  1724.  
  1725. ////////////////////////////////////////////////////////////////////////
  1726. //                                                                    //
  1727. //  Function to get input number with leading zeros                   //
  1728. //                                                                    //
  1729. ////////////////////////////////////////////////////////////////////////
  1730.  
  1731. gets_lead0(str result,int digits)
  1732.  {
  1733.  
  1734.   gets(result,digits);
  1735.   if (result == "")
  1736.      return(0);
  1737.   while (strlen(result) < digits)
  1738.         inschrs("0",result,0,1);
  1739.  
  1740.  }
  1741.  
  1742. ////////////////////////////////////////////////////////////////////////
  1743. //                                                                    //
  1744. //  Function to test if a string is all numeric                       //
  1745. //                                                                    //
  1746. ////////////////////////////////////////////////////////////////////////
  1747.  
  1748. num_str(str teststr)
  1749.  {
  1750.   int i;
  1751.  
  1752.   for (i=0; i < strlen(teststr); ++i)
  1753.       if (not isdigit(subchr(teststr,i)))
  1754.          return(0);
  1755.   return(1);
  1756.  }
  1757.