home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / WordProcessors / DAT-WW5C.DMS / in.adf / Archive / WwRexx.lha / Create_A_Memo < prev    next >
Encoding:
Text File  |  1996-02-09  |  4.0 KB  |  196 lines

  1. /*    Create_A_Memo
  2.  
  3.         Digita Wizard Script for Wordworth 5
  4.         Copyright ©1996, Digita International Ltd.
  5.         
  6.         Created: 19 January 1996
  7.         Author:  MJ & DP
  8. */
  9.  
  10.  
  11. OPTIONS FailAt 100
  12. OPTIONS RESULTS
  13.  
  14. /* Default parameters */
  15. deffromname = ""
  16. deftoname = ""
  17. defsubject = ""
  18.  
  19. defccname = "Other Recipient"
  20.  
  21. memofromname = "Sender's Name"
  22. memotoname = "Recipient's Name"
  23. memosubject = "Subject"
  24. fromname = memofromname
  25. toname = memotoname
  26. subject = memosubject
  27.  
  28. ccon = 0
  29.  
  30.  
  31. START:
  32. WizardReq TITLE "Memo Wizard" LABEL "This Wizard will create an Office Memorandum for you." LABEL "" LABEL " Click Next or press Enter to continue to the next step" LABEL " click Previous to return to the previous step, if available" LABEL " click Cancel to quit without creating a memo or" LABEL " click Finish to create a memo using the default parameters." BUTTON 1 "_Next" BUTTON 2 "_Finish" BUTTON "-1" "_Cancel"
  33. If Result = -1 THEN
  34.     EXIT
  35. IF Result = 2 THEN
  36.     SIGNAL MAKEMEMO
  37.  
  38.  
  39. /* Step 1 */
  40. STEP1:
  41. WizardReq TITLE "Memo Wizard" LABEL "Please type your name:" TEXTBOX 1 "N_ame:" CONTENTS deffromname BUTTON 1 "_Next" BUTTON 2 "_Previous" BUTTON 3 "_Finish" BUTTON "-1" "_Cancel"
  42. buttonresult = Result
  43. If buttonresult = -1 THEN
  44.     EXIT
  45. If buttonresult = 2 THEN
  46.     SIGNAL START
  47.  
  48. Wizard_GetTextBox 1
  49. fromname = Result
  50. if fromname = "" THEN
  51.     fromname = memofromname
  52.  
  53. If buttonresult = 3 THEN
  54.     SIGNAL MAKEMEMO
  55.  
  56.  
  57. /* Step 2 */
  58. STEP2:
  59. WizardReq TITLE "Memo Wizard" LABEL "Please type the recipient's name:" TEXTBOX 1 "N_ame:" CONTENTS deftoname BUTTON 1 "_Next" BUTTON 2 "_Previous" BUTTON 3 "_Finish" BUTTON "-1" "_Cancel"
  60. buttonresult = Result
  61. If buttonresult = -1 THEN
  62.     Exit
  63. If buttonresult = 2 THEN DO
  64.     deffromname = fromname
  65.     SIGNAL STEP1
  66.     END
  67.  
  68. Wizard_GetTextBox 1
  69. toname = Result
  70. if toname = "" THEN
  71.     toname = memotoname
  72.  
  73. If buttonresult = 3 THEN
  74.     SIGNAL MAKEMEMO
  75.  
  76.  
  77. /* Step 3 */
  78. STEP3:
  79. WizardReq TITLE "Memo Wizard" LABEL "Please type the subject of the memo:" TEXTBOX 1 "_Subject:" CONTENTS defsubject BUTTON 1 "_Next" BUTTON 2 "_Previous" BUTTON 3 "_Finish" BUTTON "-1" "_Cancel"
  80. buttonresult = Result
  81. If buttonresult = -1 THEN
  82.     Exit
  83. If buttonresult = 2 THEN DO
  84.     deftoname = toname
  85.     SIGNAL STEP2
  86.     END
  87.  
  88. Wizard_GetTextBox 1
  89. subject = Result
  90. if subject = "" THEN
  91.     subject = memosubject
  92.  
  93. if buttonresult = 3 THEN
  94.     SIGNAL MAKEMEMO
  95.  
  96.  
  97. STEP4:
  98. WizardReq TITLE "Memo Wizard" LABEL "Do you want copies of the memo" LABEL "to go to anyone else?" BUTTON 1 "_Yes" BUTTON 2 "_No" BUTTON "-1" "_Cancel"
  99. buttonresult = Result
  100. If buttonresult = -1 THEN
  101.     Exit
  102. IF buttonresult = 1 THEN DO
  103.     ccon = 1
  104.     ccnum = 0
  105.     ccname. = ""
  106.     Finished = 0
  107.     DO WHILE Finished = 0
  108.         ccnum = ccnum + 1
  109.         WizardReq TITLE "Memo Wizard" LABEL "Please type the name of someone that" LABEL "is to receive a copy of the memo:" TEXTBOX 1 "Nam_e:" BUTTON 1 "_Another" BUTTON 2 "No _More" BUTTON "-1" "_Cancel"
  110.         ccbuttonresult = Result
  111.         If ccbuttonresult = -1 THEN
  112.             Exit
  113.  
  114.         Wizard_GetTextBox 1
  115.         ccname.ccnum = Result
  116.         if Result = "" THEN
  117.             ccname.ccnum = defccname
  118.  
  119.         If ccbuttonresult = 2 THEN
  120.             Finished = 1
  121.     END
  122. END
  123. IF buttonresult = 2 THEN
  124.     ccon = 0
  125.  
  126.  
  127. /* Create Memorandum */
  128. MAKEMEMO:
  129. New
  130. ADDRESS VALUE Result
  131. /* Create New document and set up margins */
  132. Document A4 "0.5in" "0.5in" "0.6in" "1.0in"
  133. Paragraph 0 0 0 LEFT AUTO SINGLE NONE NONE
  134. SetTab Left "3.55cm"
  135. SetTab Right "3cm"
  136.  
  137. Font NAME "Shannon Book" SIZE "17" WIDTH 400
  138. Bold
  139. SmallCaps
  140. Text 'Memorandum'
  141. SmallCaps
  142. NewParagraph
  143.  
  144. Font NAME "Shannon Book" SIZE "12" WIDTH 100
  145. NewParagraph
  146.  
  147. Text '    To:    '
  148. Plain
  149. Text ToName
  150. NewParagraph
  151.  
  152. Bold
  153. Text '    From:    '
  154. Plain
  155. Text FromName
  156. NewParagraph
  157.  
  158. Bold
  159. Text '    Date:    '
  160. Plain
  161. InsertDate
  162. NewParagraph
  163.  
  164. Bold
  165. Text '    Subject:    '
  166. Plain
  167. Text Subject
  168. NewParagraph
  169.  
  170. IF ccon = 1 THEN DO
  171.     NewParagraph
  172.     NewParagraph
  173.     Bold
  174.     Italic
  175.     Text '    CC:    '
  176.     Plain
  177.     Italic
  178.     count = 0
  179.     DO WHILE count ~= ccnum
  180.         count = count + 1
  181.         Text ccname.count
  182.         Text "   "
  183.     END
  184.     DrawLine 1 "0.5in" "2.6in" "7.77in" "2.6in" "2pt" "60% Grey"
  185.     Plain
  186. END
  187. ELSE
  188.     DrawLine 1 "0.5in" "2.1in" "7.77in" "2.1in" "2pt" "60% Grey"
  189.  
  190. NewParagraph
  191. NewParagraph
  192. NewParagraph
  193.  
  194. RequestNotify PROMPT "The Memo Wizard has finished."
  195. End
  196.