home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 January / CHIPCD1_98.iso / software / tipsy / zoc / install.fil / SCRIPT / REGBMT.ZRX < prev    next >
Text File  |  1996-12-18  |  3KB  |  120 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 BMT Micro 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.  
  38. msg= "The next step will show the phone number of the support BBS in",
  39.     "the USA."CR,
  40.     CR"Do you want to continue?"
  41. result= ZocMsgBox(msg, 2)
  42. if result=="##NO##" THEN SIGNAL aborted
  43.  
  44. phone= ZocAsk("Please complete the following phone number", "1 910 799 0923")
  45. IF phone="##CANCEL##" THEN SIGNAL aborted
  46.  
  47. msg= "ZOC will now try to CALL the support BBS and send your order form."CR,
  48.     CR"(You can watch the transfer by moving the order form window aside.)"CR,
  49.     CR"Do you want to continue?"
  50. result= ZocMsgBox(msg, 2)
  51. IF result=="##NO##" THEN SIGNAL aborted
  52.  
  53. CALL ZocTimeout 3
  54. CALL ZocSend "AT^M"
  55. CALL ZocWait "OK"
  56. CALL ZocDial phone
  57. CALL ZocTimeout 60
  58.  
  59. result= ZocWaitmux("CONNECT", "download purposes", "NO CARRIER", "NO DIALTONE", "BUSY", "ERROR")
  60. IF result=0 | result=1 THEN DO
  61.     CALL ZocTimeout 40
  62.  
  63.     result= ZocWait("and last name:")
  64.     IF result=640 THEN SIGNAL fail
  65.     
  66.     CALL ZocDelay 1
  67.     CALL ZocSend "ZOC^M" 
  68.  
  69.     result= ZocWait("your password:")
  70.     IF result=640 THEN SIGNAL fail
  71.  
  72.     CALL ZocDelay 1
  73.     CALL ZocSend "zocuser^M"
  74.  
  75.     /* Answer all "Press Any Key" prompts with Enter */
  76.     CALL ZocReply "Press Any Key", "^M"
  77.  
  78.     result= ZocWait("Upload ZOC-Orderform")
  79.     IF result=640 THEN SIGNAL fail
  80.  
  81.     CALL ZocSend "E"
  82.  
  83.     result= ZocWait("file name.ext:")
  84.     IF result=640 THEN SIGNAL fail
  85.     
  86.     newname= LEFT(RIGHT(DATE('D'),2,"X")||TIME('S'),8,"0")||".ORD"
  87.     CALL ZocSend newname
  88.     CALL ZocSend "^M"
  89.  
  90.     result= ZocUpload("ZModem", ".\"file)
  91.  
  92.     IF result="##OK##" THEN DO
  93.         CALL ZocWait "<D> Disconnect"
  94.         CALL ZocDelay 1
  95.         CALL ZocSend "D"
  96.         CALL ZocDelay 5
  97.         CALL ZocHangup
  98.         CALL ZocMsgBox "Your order was delivered successfully. Thank you!"
  99.     END
  100.     ELSE DO
  101.         CALL ZocMsgBox "Error while sending. The order was *NOT* sent!"
  102.     END
  103. END /* IF */
  104. ELSE DO
  105.     CALL ZocHangup
  106.     CALL ZocMsgBox "Sorry, connection failed. The order was *NOT* sent!"
  107. END /* ELSE */
  108. EXIT
  109.  
  110.  
  111. fail:
  112.     CALL ZocHangup
  113.     CALL ZocMsgBox "Sorry, connection failed. The order was *NOT* sent!"
  114.     EXIT
  115.  
  116. aborted:
  117.     CALL ZocMsgBox "User aborted. The order was *NOT* sent!"
  118.     EXIT
  119.  
  120.