home *** CD-ROM | disk | FTP | other *** search
/ Merciful 3 / Merciful_Release_3.bin / software / e / executivev1.3cracked.lha / executive / register / Register.rexx < prev   
OS/2 REXX Batch file  |  1996-02-09  |  9KB  |  257 lines

  1. /*
  2.  * Fill in a registration form for Executive.
  3.  *
  4.  * Copyright © 1995 Petri Nordlund. All rights reserved.
  5.  *
  6.  * $Id: Register.rexx 1.3 1995/11/15 12:34:30 petrin Exp petrin $
  7.  *
  8.  */
  9.  
  10. regform = 'RAM:regform'
  11.  
  12. csi='9b'x;f.slant=csi'3m'; f.bold=csi'1m'; f.norm=csi'0m'
  13.              f.black=csi'31m'; f.white=csi'32m'; f.blue=csi'33m'
  14.              f.lf = '0a'x; f.cls = csi'0;0H'csi'J'
  15.  
  16. options prompt f.white'> 'f.black
  17.  
  18. payment1  = "Cash (please don't send coins)"
  19. payment2  = 'Eurocheque for 70 FIM'
  20. payment2a = '- you must write your card number on the back of the cheque'
  21. payment3  = 'Money transfer of 70 FIM to this account:'
  22. payment3a = '- bank: Postipankki Ltd, Helsinki, Finland'
  23. payment3b = '- account number 8000 29-26522193'
  24. payment3c = '- pay via Eurogiro or SWIFT'
  25. payment3d = '- SWIFT address: PSPBFIHH; Telex 121 698 pgiro fi'
  26. payment3e = '- include a copy of the receipt with this form'
  27. payment4  = 'Postiennakko (Finland only)'
  28. payment4a = '- postiennakkomaksu 25 mk lisätään hintaan (70+25=95 mk)'
  29.  
  30. cash1  = '$15 (US dollar)'
  31. cash2  = '£10 (Pound sterling)'
  32. cash3  = '70 FIM (Finnish mark)'
  33. cash4  = '20 DEM (Deutsche mark)'
  34. cash5  = '100 NOK (Norwegian krone)'
  35. cash6  = '120 SEK (Swedish krona)'
  36. cash7  = '500 BEF (Belgian franc)'
  37. cash8  = '70 FRF (French franc)'
  38. cash9  = '25 NLG (Dutch guilder)'
  39. cash10 = '100 DKK (Danish krone)'
  40.  
  41. delivery1 = 'by airmail on a 3.5" disk'
  42. delivery2 = 'keyfile emailed to you'
  43.  
  44. say f.white
  45. say 'Welcome to Executive registration form generator.'
  46. say 'Now please answer all the questions. The registration form is written'
  47. say 'to file 'f.bold''regform''f.norm''f.white'. You can abort by pressing CTRL-C. When'
  48. say 'several lines are available for your answer, just hit ENTER on the'
  49. say 'lines you don''t need.'
  50. say f.black
  51.  
  52.  
  53. /* User */
  54. say 'What is your name?'
  55. parse pull i_Name
  56. say
  57.  
  58. say 'What is your full snailmail address (including country)? [5 lines available]'
  59. i_Addr1 = GetLine(1)
  60. i_Addr2 = GetLine(2)
  61. i_Addr3 = GetLine(3)
  62. i_Addr4 = GetLine(4)
  63. i_Addr5 = GetLine(5)
  64. say
  65.  
  66. say 'What is your phone number?'
  67. parse pull i_Phone
  68. say
  69.  
  70. say 'What is your Internet email address?'
  71. parse pull i_Email
  72. say
  73.  
  74. say 'Payment by:  1. 'payment1
  75. say '             2. 'payment2
  76. say '                'payment2a
  77. say '             3. 'payment3
  78. say '                'payment3a
  79. say '                'payment3b
  80. say '                'payment3c
  81. say '                'payment3d
  82. say '                'payment3e
  83. say '             4. 'payment4
  84. say '                'payment4a
  85. parse pull i_PaymentBy
  86. say
  87.  
  88. if i_PaymentBy = 1 then do
  89. say 'Currency:    1. 'cash1
  90. say '             2. 'cash2
  91. say '             3. 'cash3
  92. say '             4. 'cash4
  93. say '             5. 'cash5
  94. say '             6. 'cash6
  95. say '             7. 'cash7
  96. say '             8. 'cash8
  97. say '             9. 'cash9
  98. say '            10. 'cash10
  99. parse pull i_Currency
  100. say
  101. end
  102.  
  103. say 'Delivery:    1. 'delivery1
  104. say '             2. 'delivery2
  105. parse pull i_Delivery
  106. say
  107.  
  108. /* Write registration form */
  109.  
  110. outf = 'rffile'
  111. if open(outf,regform,'W') then do
  112.     call writeln(outf,'##    ## #####  ####  ##')
  113.     call writeln(outf,' ##  ##  ##    ##     ##')
  114.     call writeln(outf,'  ####   ####   ###   ##')
  115.     call writeln(outf,'   ##    ##       ##')
  116.     call writeln(outf,'   ##    ##### ####   ##    Please send me a keyfile for Executive!')
  117.     call writeln(outf,'___________________________________________________________________________' f.lf f.lf)
  118.     call writeln(outf,'Name:       'i_Name f.lf)
  119.     call writeln(outf,'Address:    'i_Addr1)
  120.     call writeln(outf,'            'i_Addr2)
  121.     call writeln(outf,'            'i_Addr3)
  122.     call writeln(outf,'            'i_Addr4)
  123.     call writeln(outf,'            'i_Addr5 f.lf)
  124.     call writeln(outf,'Phone:      'i_Phone f.lf)
  125.     call writeln(outf,'Email:      'i_Email f.lf)
  126.     call writeln(outf,'')
  127.  
  128.     if i_PaymentBy = 1 then do
  129.         call writeln(outf,'Payment by: [X] 'payment1)
  130.         if i_Currency = 1  then call writeln(outf,'                - 'cash1)
  131.         if i_Currency = 2  then call writeln(outf,'                - 'cash2)
  132.         if i_Currency = 3  then call writeln(outf,'                - 'cash3)
  133.         if i_Currency = 4  then call writeln(outf,'                - 'cash4)
  134.         if i_Currency = 5  then call writeln(outf,'                - 'cash5)
  135.         if i_Currency = 6  then call writeln(outf,'                - 'cash6)
  136.         if i_Currency = 7  then call writeln(outf,'                - 'cash7)
  137.         if i_Currency = 8  then call writeln(outf,'                - 'cash8)
  138.         if i_Currency = 9  then call writeln(outf,'                - 'cash9)
  139.         if i_Currency = 10 then call writeln(outf,'                - 'cash10)
  140.         call writeln(outf,'            [ ] 'payment2)
  141.         call writeln(outf,'                'payment2a)
  142.         call writeln(outf,'            [ ] 'payment3)
  143.         call writeln(outf,'                'payment3a)
  144.         call writeln(outf,'                'payment3b)
  145.         call writeln(outf,'                'payment3c)
  146.         call writeln(outf,'                'payment3d)
  147.         call writeln(outf,'                'payment3e)
  148.         call writeln(outf,'            [ ] 'payment4)
  149.         call writeln(outf,'                'payment4a)
  150.         end
  151.  
  152.     if i_PaymentBy = 2 then do
  153.         call writeln(outf,'Payment by: [ ] 'payment1)
  154.         call writeln(outf,'            [X] 'payment2)
  155.         call writeln(outf,'                'payment2a)
  156.         call writeln(outf,'            [ ] 'payment3)
  157.         call writeln(outf,'                'payment3a)
  158.         call writeln(outf,'                'payment3b)
  159.         call writeln(outf,'                'payment3c)
  160.         call writeln(outf,'                'payment3d)
  161.         call writeln(outf,'                'payment3e)
  162.         call writeln(outf,'            [ ] 'payment4)
  163.         call writeln(outf,'                'payment4a)
  164.         end
  165.  
  166.     if i_PaymentBy = 3 then do
  167.         call writeln(outf,'Payment by: [ ] 'payment1)
  168.         call writeln(outf,'            [ ] 'payment2)
  169.         call writeln(outf,'                'payment2a)
  170.         call writeln(outf,'            [X] 'payment3)
  171.         call writeln(outf,'                'payment3a)
  172.         call writeln(outf,'                'payment3b)
  173.         call writeln(outf,'                'payment3c)
  174.         call writeln(outf,'                'payment3d)
  175.         call writeln(outf,'                'payment3e)
  176.         call writeln(outf,'            [ ] 'payment4)
  177.         call writeln(outf,'                'payment4a)
  178.         end
  179.  
  180.     if i_PaymentBy = 4 then do
  181.         call writeln(outf,'Payment by: [ ] 'payment1)
  182.         call writeln(outf,'            [ ] 'payment2)
  183.         call writeln(outf,'                'payment2a)
  184.         call writeln(outf,'            [ ] 'payment3)
  185.         call writeln(outf,'                'payment3a)
  186.         call writeln(outf,'                'payment3b)
  187.         call writeln(outf,'                'payment3c)
  188.         call writeln(outf,'                'payment3d)
  189.         call writeln(outf,'                'payment3e)
  190.         call writeln(outf,'            [X] 'payment4)
  191.         call writeln(outf,'                'payment4a)
  192.         end
  193.  
  194.     call writeln(outf,f.lf)
  195.  
  196.     if i_Delivery = 1 then do
  197.     call writeln(outf,'Delivery:   [X] 'delivery1)
  198.     call writeln(outf,'            [ ] 'delivery2)
  199.     end
  200.     else do
  201.     call writeln(outf,'Delivery:   [ ] 'delivery1)
  202.     call writeln(outf,'            [X] 'delivery2)
  203.     end
  204.  
  205.     call writeln(outf,f.lf f.lf)
  206.     call writeln(outf,'Registration date:' date() f.lf f.lf f.lf f.lf)
  207.     call writeln(outf,'______________________________________')
  208.     call writeln(outf,'signature' f.lf f.lf)
  209.     call writeln(outf,'Thank you for registering Executive!' f.lf f.lf)
  210.     call writeln(outf,'___________________________________________________________________________')
  211.     call writeln(outf,'Petri Nordlund      email: petrin@megabaud.fi')
  212.     call writeln(outf,'Vanhamaantie 4             petrin@sik.ppoy.fi')
  213.     call writeln(outf,'28800  PORI')
  214.     call writeln(outf,'FINLAND             WWW:   http://www.megabaud.fi/~petrin/Executive.html')
  215.  
  216. say 'The registration form has been written to file 'f.bold''regform''f.norm'.'
  217. say 'This file is a normal ASCII file, so you can edit it with a text'
  218. say 'editor if necessary.'
  219.  
  220. say f.white f.slant
  221. say 'Thank you for registering Executive!' f.norm f.black f.lf
  222.  
  223. end
  224. else
  225.     signal error_file
  226.  
  227. address command 'delete RAM:_regform.tmp >NIL:'
  228.  
  229. exit 0
  230. /* MAIN PROGRAM ENDS HERE, PROCEDURES FOLLOW */
  231.  
  232. /* Failed when trying to write the registration form file */
  233. error_file:
  234.   say f.white f.bold
  235.   say 'Can''t write file "'regform'".'
  236.   say f.norm f.black
  237.   exit 20
  238.  
  239.  
  240. /* GetRes */
  241. GetRes:
  242.   if open(6Res, 'RAM:_regform.tmp', 'R') then do
  243.     Res = readln(6Res)
  244.     call close 6Res
  245.   end
  246.   else
  247.     Res = ''
  248.   return Res
  249.  
  250.  
  251. /* GetLine */
  252. GetLine:
  253.   options prompt f.white''arg(1)'> 'f.black
  254.   parse pull str
  255.   options prompt f.white'> 'f.black
  256.   return str
  257.