home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_1_1994.iso / 00091 / s / register.sc_ / WRLYREG1.SCR < prev    next >
Text File  |  1993-09-03  |  5KB  |  102 lines

  1. *  WRLYREG1.SCR - Relay/PC Gold for Windows Online Registration Script
  2. *  (c) Copyright 1993 Relay Technology Inc.
  3. *
  4. * FUNCTION: This script will build the registration file and send it to the
  5. *           registration PC.  It is implied that DDE communications will set
  6. *           the variable ®NUM to the telephone number to dial and &DATAREC1-6
  7. *           will contain a string of tokens to build the registration file.
  8. *           This script works exclusively with Relay/PC Gold for Windows.
  9.  
  10.           on error
  11.           set attend off
  12.           global &PASSWORD;&PASSWORD = "CHECK6"
  13.           global &CONT; &CONT = N
  14.           &COMFILE = "RELAY.BIN"
  15.  
  16. * Make sure script directory has trailing backslash
  17.           if (&substr(&SCRDIR,&len(&SCRDIR),1) <> "\")
  18.             then &SCRDIR = &SCRDIR.\
  19.  
  20. * Build file <serial#>.REG
  21.           gosub FINISH
  22.           &HRC = &rc
  23.           if (&HRC <> 0) then &MSG1 = "Not able to build registration file."
  24.           then quiet stop
  25.           &CALLNAME = "REG_PC"  ;* try COM1 connection file 1st
  26.  
  27. -OK3
  28.           quiet call "&CALLNAME" nodisplay
  29.           &HRC = &rc
  30.           wait 1  
  31.           if (&HRC=3) or (&HRC=5) or (&HRC=6) or (&HRC=9) or (&HRC=15) or (&HRC=16) or (&HRC=17) then goto NEXTPORT
  32.  
  33. * Assign message and stop script
  34.           else gosub DOMSG
  35.           else quiet stop
  36.  
  37. -NEXTPORT
  38. * If we already tried COM2, then stop script
  39.           if (&CALLNAME="REG2_PC") then gosub DOMSG
  40.           then quiet stop
  41.  
  42. * Otherwise, try COM2
  43.           &CALLNAME="REG2_PC"
  44.           goto OK3
  45.  
  46. -FINISH  
  47.           gosub GETZAP
  48.           open &SCRDIR.&rserial..REG as #1 for output
  49.           &HRC = &rc
  50.           if (&HRC <> 0) then return 1
  51.  
  52. * Write NAME through ZIP for 1st page
  53.           write file #1 "Relay/PC Gold for Windows &ZAPLVL Registration &rserial &date"
  54.           write file #1 &DATAREC1
  55.           write file #1 "&DATAREC2"
  56.           write file #1 "&DATAREC3"
  57.           write file #1 "&DATAREC4"
  58.           write file #1 "&DATAREC5"
  59.           write file #1 "&DATAREC6"
  60.           if (&DATAREC7 <> "") write file #1 "&DATAREC7"
  61.           if (&DATAREC8 <> "") write file #1 "&DATAREC8"
  62.           if (&DATAREC9 <> "") write file #1 "&DATAREC9"
  63.           close #1
  64.           &HRC = &rc
  65.           if (&HRC <> 0) then return 1
  66.           return
  67.  
  68. *
  69. * Open RELAY.BIN and grab the current ZAP Level.  Save it to a variable.
  70. *
  71. -GETZAP   open &RDRIVE\&COMFILE as #1 length 1   
  72.           point #1 145                            ;* Point to the ZAP level
  73.           read file #1 &REC length 1              ;* Read the current ZAP level
  74.           &ZAPLVL = &decimal(&ascii(&REC))        ;* Convert ZAP level to ascii
  75.           if (&length(&ZAPLVL)=1)                 ;* If needed, pad with a zero
  76.             then &ZAPLVL = "0&ZAPLVL"
  77.           close #1                               
  78.           return
  79.  
  80. * Routine to assign message
  81. -DOMSG
  82.           if (&HRC = 98) then &MSG1 = "Inadvertent line drop before file transfer was completed."
  83.           else if (&HRC = 90) then &MSG1 = "Registration file was sent successfully."
  84.           else if (&HRC = 0) then &MSG1 = "User performed hangup."
  85.           else if (&HRC = 2) then &MSG1 = "Insufficient memory for the connection."
  86.           else if (&HRC = 3) then &MSG1 = "The communication port is not operational for Connection File &CALLNAME."
  87.           else if (&HRC = 4) then &MSG1 = "User pressed ESC while dialing, cancelling the call."
  88.           else if (&HRC = 5) then &MSG1 = "Make sure modem type is correct for the communication port."
  89.           else if (&HRC = 6) then &MSG1 = "No carrier detected on line."
  90.           else if (&HRC = 7) then &MSG1 = "The other computer is busy."
  91.           else if (&HRC = 8) then &MSG1 = "Voice detected on telephone line."
  92.           else if (&HRC = 9) then &MSG1 = "No dial tone on telephone line."
  93.           else if (&HRC = 15) then &MSG1 = "Connection File '&CALLNAME' not available."
  94.           else if (&HRC = 17) then &MSG1 = "The communication port is not properly configured for Connection File &CALLNAME."
  95.           else if (&HRC = 97) then &MSG1 = "Registration PC not operational."
  96.           else if (&HRC = 96) then &MSG1 = "Invalid password detected."
  97.           else if (&HRC = 95) then &MSG1 = "Problem initiating transfer of registration file"
  98.           else if (&HRC = 94) then &MSG1 = "Problem occurred during transfer of registration file"
  99.           else if (&HRC = 93) then &MSG1 = "Registration PC already has your registration file"
  100.           else if (&HRC = 100) then &MSG1 = "Registration PC is not responding - try again later."
  101.           return
  102.