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