home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / zow314.exe / INSTALL.FIL / SCRIPT / REGCOMPU.OLD < prev    next >
Text File  |  1996-12-18  |  4KB  |  134 lines

  1. /* REXX */
  2.  
  3. CR=d2c(13)
  4. CRCR=CR||CR
  5. PARSE VALUE ARG(1) WITH file
  6.  
  7. IF file="" THEN DO
  8.     msg= "This REXX program is only for use by the ZOC order form!"||CRCR
  9.     CALL ZocMsgBox msg
  10.     EXIT
  11. END
  12.  
  13. msg= "You are about to transfer your order form to CompuLab via modem."||CR,
  14.     CR"This is a 3 step procedure which you may abort at any point."||CR,
  15.     CR"Do you want to continue?"
  16. result= ZocMsgBox(msg, 2)
  17. IF result=="##NO##" THEN SIGNAL aborted
  18.  
  19. msg= "Please make sure that ZOC is correctly configured for modem",
  20.     "communication."||CR,
  21.     CR"Do you want to continue?"
  22. result= ZocMsgBox(msg, 2)
  23. IF result=="##NO##" THEN SIGNAL aborted
  24.  
  25. msg= "In the next step, the order form will be shown.  Please check",
  26.     "if ordered products, credit card numbers, etc. are correct."CR,
  27.     CR"Do you want to continue?"
  28. result= ZocMsgBox(msg, 2)
  29. IF result=="##NO##" THEN SIGNAL aborted
  30.  
  31. PARSE VALUE ZocOS() with osysstr osversion
  32. IF osysstr="OS2" then 
  33.     ADDRESS CMD "E "file
  34. else
  35.     ADDRESS CMD "NOTEPAD "file
  36.  
  37. msg= "The next step will show the phone number of the support BBS in",
  38.     "Germany.  Outside Germany please replace 0911 with your international",
  39.     "dial prefix and German country/city code (49 911).  In the U.S.",
  40.     "this is probably 011 49 911. "CR,
  41.     CR"Do you want to continue?"
  42. result= ZocMsgBox(msg, 2)
  43. if result=="##NO##" THEN SIGNAL aborted
  44.  
  45. phone= ZocAsk("Please complete the following phone number", "0911 3781200")
  46. IF phone="##CANCEL##" THEN SIGNAL aborted
  47.  
  48. msg= "ZOC will now try to call the support BBS and send your order form."CR,
  49.     "(You can watch the transfer by moving the order form window aside.)"CR,
  50.     CR"Do you want to continue?"
  51. result= ZocMsgBox(msg, 2)
  52. IF result=="##NO##" THEN SIGNAL aborted
  53.  
  54. CALL ZocTimeout 3
  55. CALL ZocSend "AT^M"
  56. CALL ZocWait "OK"
  57. CALL ZocDial phone
  58. CALL ZocTimeout 60
  59.  
  60. result= ZocWaitmux("CONNECT", "(MSN)", "NO CARRIER", "NO DIALTONE", "BUSY", "ERROR")
  61.  
  62. IF result=0 | result=1 THEN do
  63.     CALL ZocTimeout 40
  64.     
  65.     result= ZocWait("Name")
  66.     IF result=640 THEN SIGNAL fail
  67.     
  68.     CALL ZocDelay 1
  69.     CALL ZocSend "ZOC^M"
  70.     
  71.     result= ZocWait("Ihre Wahl")
  72.     IF result=640 THEN SIGNAL fail
  73.     
  74.     CALL ZocDelay 1
  75.     CALL ZocSend "Y^M"
  76.     
  77.     result= ZocWait("Bitte Text eingeben")
  78.     IF result=640 THEN SIGNAL fail
  79.     
  80.     CALL ZocDelay 1
  81.     CALL ZocSend "THIS REGISTRATION WAS DELIVERED BY REGCOMPU.ZRX^M^M"
  82.     
  83.     stuffseen= 0
  84.     linecnt= 0
  85.     DO FOREVER 
  86.         line= LINEIN(file)                /* read line from file */
  87.         line= STRIP(line,'l',D2C(9))    /* remove leading TAB characters */
  88.         line= STRIP(line,'l')            /* remove leading space characters */
  89.         linecnt= linecnt+1
  90.         if STREAM(file, 's')\="READY" THEN /* EOF */
  91.             LEAVE
  92.        
  93.         IF stuffseen=0 & line="" THEN 
  94.             ITERATE
  95.         ELSE
  96.             stuffseen= 1
  97.         
  98.         CALL ZocSend "    "||line
  99.         CALL ZocSend "^M"
  100.     END /* DO */
  101.     CALL ZocSend ".^M"
  102.     
  103.     CALL ZocTimeout 20
  104.     result= ZocWait("Eingabe beendet.")
  105.     IF result=0 & linecnt>10 THEN DO
  106.         CALL ZocWait "Ihre Wahl"
  107.         CALL ZocDelay 1
  108.         CALL ZocSend "Z^M"
  109.         CALL ZocDelay 5
  110.         CALL ZocHangup
  111.         CALL ZocMsgBox "Your order was delivered successfully. Thank you!"
  112.     END
  113.     ELSE DO
  114.         CALL ZocMsgBox "Error while sending. The order was *NOT* sent!"
  115.     END
  116. END /* IF */
  117. ELSE DO
  118.     CALL ZocHangup
  119.     CALL ZocMsgBox "Sorry, connection failed. The order was *NOT* sent!"
  120. END /* ELSE */
  121.  
  122. EXIT
  123.  
  124.  
  125. fail:
  126.     CALL ZocHangup
  127.     CALL ZocMsgBox "Sorry, connection failed. The order was *NOT* sent!"
  128.     EXIT
  129.  
  130. aborted:
  131.     CALL ZocMsgBox "User aborted. The order was *NOT* sent!"
  132.     EXIT
  133.  
  134.