home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / PCLPACK.ZIP / COMP.ZIP / READ.ME < prev   
Encoding:
Text File  |  1993-04-13  |  6.5 KB  |  177 lines

  1. Compound Commands   04/13/93  by  Douglas B. Vermes
  2.  
  3. ------------------------------------------------------------------------
  4. NOTE: All Commands Appear in Quotes, but should not be put into a PCL
  5.       file in Quotes.
  6.  
  7. "Jump(ST_CHECK)" - This command must come before the first prompt in the
  8.                    PCL File, and before any references to the prompt.
  9.  
  10. Consider the Example below:
  11. -----------------------------------------------------------------------
  12.  
  13. *Disp
  14. SetActivity (Main Menu)
  15. if(/EXPERT)=(Y) then linefeed(1)
  16. if(/EXPERT)=(Y) then Goto (Prompt)
  17. *sdisp
  18. Display (display\main,/:SEC/)
  19.  
  20. *Prompt
  21. Say(&14&│$7$&0&%CACT%$0$&14&│&7& You have &15&%LEFT% &7&minutes remaining, *)
  22. MenuAsk %MIN1%(&15&%FNAME%.&CR&&3&Please enter a selection from the &11&menu&12&: &15&*)
  23. -----------------------------------------------------------------------
  24. The "Jump(ST_CHECK)" Command should go anywhere before the line that reads
  25. "If(/EXPERT)=(Y) then Goto (Prompt)", because that line goes to a prompt and,
  26. thus, is a reference to the prompt. The command should also always go after
  27. the label (i.e. "*Disp") unless otherwise stated (or if there is no label).
  28.  
  29. "Jump(C_CHECK)" - This command goes directly after an input from the user
  30.                   prompt (i.e. "MenuAsk", "Ask", etc.) but BEFORE any 
  31.                   %RESP% checking.
  32.  
  33. Consider the following example:
  34. -----------------------------------------------------------------------
  35. *Prompt
  36. Say(&14&│$7$&0&%CACT%$0$&14&│&7& You have &15&%LEFT% &7&minutes remaining, *)
  37. MenuAsk %MIN1%(&15&%FNAME%.&CR&&3&Please enter a selection from the &11&menu&12&: &15&*)
  38. BigIf (G:BYE,H:HELP,?:SDISP,X:EXP,P:PAGE,Y:STATS,N:NEWS,C:CMNT,B:BMN,Q:QMN,F:FMN,M:MMN,D:DMN,L:LIST,@:SMN,WHO:WHO,CHAT:CHAT,FIND:FND,BANK:BNK,VER:SL0)
  39. -----------------------------------------------------------------------
  40. The "Jump(C_CHECK)" should go right after the "MenuAsk" line but BEFORE the
  41. "BigIf" line, because the BigIf is doing %RESP% checking. 
  42.  
  43. "*COMMAND" - This Label Should Come right after the "Jump(C_CHECK)" but
  44.              BEFORE the %RESP% checking. (Directly before the %RESP%
  45.              checking, if possible.) 
  46.  
  47. In the previous example (beginning with "*Prompt"), the "*COMMAND" label
  48. should go right before the "BigIf" command, after where the "Jump(C_CHECK)"
  49. belongs. 
  50.  
  51. At the end of the PCL file, you need to put the labels "*ST_CHECK",
  52. "*C_CHECK","*NoMoreCommands", and "*Cont". The example below is what
  53. each label should contain, and where they should be placed in reference
  54. to one another. (It is best to just capture that section and use it.) 
  55.  
  56. -----------------------------------------------------------------------
  57. *C_CHECK
  58. SetEqual(z=;)
  59. ;Z will be search character (' ' or ';')
  60. Find(%RESP%,;)
  61. If (%ARESP%)=(0) Then 
  62.  Find(%RESP%, )
  63.  If(%ARESP%)=(0) then Ret
  64.  SetEqual(z= )
  65. endif
  66. ;SetEqual(/nvz=%RESP%)
  67. SetEqual(^1=%RESP%)
  68. *ST_CHECK
  69. ;SetEqual(a=%NV%Z)
  70. SetEqual(a=^:1^)
  71. If(%VAR%A)=() then Ret
  72. Find(%VAR%A,%VAR%Z)
  73. If(%ARESP%)=(0) then Goto(NoMoreCommands)
  74. AddVar(%ARESP%+-1=b)
  75. Get(%VAR%A,1,%VAR%B)
  76. SetEqual(/resp=%ARESP%)
  77. *Cont
  78. If (%RESP%)=() Then Ret
  79. AddVar(%VAR%B+2=b)
  80. Get(%VAR%A,%VAR%B,100)
  81. ;SetEqual(/nvz=%ARESP%)
  82. SetEqual(^1=%ARESP%)
  83. Goto(COMMAND)
  84. Ret
  85.  
  86. *NoMoreCommands
  87.  SetEqual(/resp=^:1^)
  88.  SetEqual(^1=)
  89.  If (%RESP%)=() Then Ret
  90.  Goto(command)
  91. -----------------------------------------------------------------------
  92.  
  93. MULTIPLE PROMPTS -- For more than one prompt in a PCL file which you want
  94.                     handled by the Compound Command routine, use the same
  95.                     code (previous example), but change the labels. For
  96.                     a second prompt, the labels should be: 
  97.                         "*ST_CHECK2","*C_CHECK2","*NoMoreCommands2","*Cont2"
  98.                     Don't forget-- the "*COMMAND" label must be "*COMMAND2"
  99.                     for a second prompt. And so on...
  100.  
  101.  
  102. YESNOASK Prompts -- These Prompts Differ From Normal Ask prompts in that
  103.                     they require the %RESP% information to be either
  104.                     "Yes" or "No". The following example is a modified
  105.                     version of the normal Compound Command routine, to
  106.                     be used for YesNoAsk prompts (in this example, the
  107.                     prompt happens to be the second one. This is denoted
  108.                     by the "2"s which end all the labels):
  109.  
  110. -----------------------------------------------------------------------
  111. *Cont2
  112. If (%RESP%)=() Then Ret
  113. AddVar(%VAR%B+2=b)
  114. Get(%VAR%A,%VAR%B,100)
  115. ;SetEqual(/nvz=%ARESP%)
  116. SetEqual(^1=%ARESP%)
  117. Goto(COMMAND2)
  118. Ret
  119.  
  120. *ST_CHECK2
  121. ;SetEqual(a=%NV%Z)
  122. SetEqual(a=^:1^)
  123. Find(%VAR%A,%VAR%Z)
  124. If(%ARESP%)=(0) then Goto(NoMoreCommands2)
  125. AddVar(%ARESP%+-1=b)
  126. Get(%VAR%A,1,%VAR%B)
  127. MenuEqual(/resp=%ARESP%)
  128. *YNRespChecks2
  129. If(%RESP%)=(Y) then SetEqual(/RESP=Yes)
  130. If(%RESP%)=(N) then SetEqual(/RESP=No)
  131. ;SetEqual(/resp=%ARESP%)
  132. NotIf(%RESP%)=(Yes) then NotIf(%RESP%)=(No) then Goto(Question2)
  133. Goto(Cont2)
  134.  
  135. *NoMoreCommands2
  136.  MenuEqual(/resp=^:1^)
  137.  SetEqual(^1=)
  138.  Goto(YNRespChecks2)
  139. -----------------------------------------------------------------------
  140.  
  141. The two main differences between this routine and the normal routine is 
  142. that this one includes a "*YNRespChecks2" label, and also that you must
  143. put a "*Question2" directly before the prompt which asks the YesNoAsk
  144. question. (This is the label the routine goes to if the user does not
  145. enter a valid Y or N in the compound command.) 
  146.  
  147. -----------------------------------------------------------------------
  148.  Say(&CR&&11&Area #%RESP%: &15&%FILNAME% &11&is now selected!&CR&)
  149.  Jump(ST_Check2)
  150.  *Question2
  151.  Say(&3&Would you like to list this area? &9&[   ]&14&*)
  152.  Back(4)
  153.  YesNoAsk()
  154.  *COMMAND2
  155.  If (%RESP%)=(Yes) Then loadsub(control\macros\flist.ctl)
  156. -----------------------------------------------------------------------
  157. Note the placement of the "*Question2" label in the above example.
  158.  
  159.  
  160. EXCEPTIONS   --  
  161.  
  162.    MACROS\CHANGE.CTL   : YesNoAsk Prompt
  163.    MACROS\EXPERT.CTL   : Change all "Enter" commands to
  164.    MACROS\ABAND.CTL      "If (^:1^)=() then Enter"
  165.   
  166.  
  167.    MACROS\ZVIEW.CTL    : There is already a "*Cont" label-- make the
  168.                          new "*Cont" label "*Cont2"
  169.    MACROS\BYE.CTL      : YesNoAsk prompt
  170.    MACROS\COMMENT.CTL  : (See Sample File)
  171.    MACROS\NEW.CTL
  172.    MACROS\SELFILEA.CTL
  173.    MACROS\DOWN.CTL
  174.    MACROS\UBATCH.CTL   : "Jump(ST_CHECK)" must go BEFORE "*Fname" label
  175.    MACROS\BATCH.CTL    : "Jump(ST_CHECK)" must go AFTER "*Fname" label
  176.  
  177.