home *** CD-ROM | disk | FTP | other *** search
- Compound Commands 04/13/93 by Douglas B. Vermes
-
- ------------------------------------------------------------------------
- NOTE: All Commands Appear in Quotes, but should not be put into a PCL
- file in Quotes.
-
- "Jump(ST_CHECK)" - This command must come before the first prompt in the
- PCL File, and before any references to the prompt.
-
- Consider the Example below:
- -----------------------------------------------------------------------
-
- *Disp
- SetActivity (Main Menu)
- if(/EXPERT)=(Y) then linefeed(1)
- if(/EXPERT)=(Y) then Goto (Prompt)
- *sdisp
- Display (display\main,/:SEC/)
-
- *Prompt
- Say(&14&│$7$&0&%CACT%$0$&14&│&7& You have &15&%LEFT% &7&minutes remaining, *)
- MenuAsk %MIN1%(&15&%FNAME%.&CR&&3&Please enter a selection from the &11&menu&12&: &15&*)
- -----------------------------------------------------------------------
- The "Jump(ST_CHECK)" Command should go anywhere before the line that reads
- "If(/EXPERT)=(Y) then Goto (Prompt)", because that line goes to a prompt and,
- thus, is a reference to the prompt. The command should also always go after
- the label (i.e. "*Disp") unless otherwise stated (or if there is no label).
-
- "Jump(C_CHECK)" - This command goes directly after an input from the user
- prompt (i.e. "MenuAsk", "Ask", etc.) but BEFORE any
- %RESP% checking.
-
- Consider the following example:
- -----------------------------------------------------------------------
- *Prompt
- Say(&14&│$7$&0&%CACT%$0$&14&│&7& You have &15&%LEFT% &7&minutes remaining, *)
- MenuAsk %MIN1%(&15&%FNAME%.&CR&&3&Please enter a selection from the &11&menu&12&: &15&*)
- 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)
- -----------------------------------------------------------------------
- The "Jump(C_CHECK)" should go right after the "MenuAsk" line but BEFORE the
- "BigIf" line, because the BigIf is doing %RESP% checking.
-
- "*COMMAND" - This Label Should Come right after the "Jump(C_CHECK)" but
- BEFORE the %RESP% checking. (Directly before the %RESP%
- checking, if possible.)
-
- In the previous example (beginning with "*Prompt"), the "*COMMAND" label
- should go right before the "BigIf" command, after where the "Jump(C_CHECK)"
- belongs.
-
- At the end of the PCL file, you need to put the labels "*ST_CHECK",
- "*C_CHECK","*NoMoreCommands", and "*Cont". The example below is what
- each label should contain, and where they should be placed in reference
- to one another. (It is best to just capture that section and use it.)
-
- -----------------------------------------------------------------------
- *C_CHECK
- SetEqual(z=;)
- ;Z will be search character (' ' or ';')
- Find(%RESP%,;)
- If (%ARESP%)=(0) Then
- Find(%RESP%, )
- If(%ARESP%)=(0) then Ret
- SetEqual(z= )
- endif
- ;SetEqual(/nvz=%RESP%)
- SetEqual(^1=%RESP%)
- *ST_CHECK
- ;SetEqual(a=%NV%Z)
- SetEqual(a=^:1^)
- If(%VAR%A)=() then Ret
- Find(%VAR%A,%VAR%Z)
- If(%ARESP%)=(0) then Goto(NoMoreCommands)
- AddVar(%ARESP%+-1=b)
- Get(%VAR%A,1,%VAR%B)
- SetEqual(/resp=%ARESP%)
- *Cont
- If (%RESP%)=() Then Ret
- AddVar(%VAR%B+2=b)
- Get(%VAR%A,%VAR%B,100)
- ;SetEqual(/nvz=%ARESP%)
- SetEqual(^1=%ARESP%)
- Goto(COMMAND)
- Ret
-
- *NoMoreCommands
- SetEqual(/resp=^:1^)
- SetEqual(^1=)
- If (%RESP%)=() Then Ret
- Goto(command)
- -----------------------------------------------------------------------
-
- MULTIPLE PROMPTS -- For more than one prompt in a PCL file which you want
- handled by the Compound Command routine, use the same
- code (previous example), but change the labels. For
- a second prompt, the labels should be:
- "*ST_CHECK2","*C_CHECK2","*NoMoreCommands2","*Cont2"
- Don't forget-- the "*COMMAND" label must be "*COMMAND2"
- for a second prompt. And so on...
-
-
- YESNOASK Prompts -- These Prompts Differ From Normal Ask prompts in that
- they require the %RESP% information to be either
- "Yes" or "No". The following example is a modified
- version of the normal Compound Command routine, to
- be used for YesNoAsk prompts (in this example, the
- prompt happens to be the second one. This is denoted
- by the "2"s which end all the labels):
-
- -----------------------------------------------------------------------
- *Cont2
- If (%RESP%)=() Then Ret
- AddVar(%VAR%B+2=b)
- Get(%VAR%A,%VAR%B,100)
- ;SetEqual(/nvz=%ARESP%)
- SetEqual(^1=%ARESP%)
- Goto(COMMAND2)
- Ret
-
- *ST_CHECK2
- ;SetEqual(a=%NV%Z)
- SetEqual(a=^:1^)
- Find(%VAR%A,%VAR%Z)
- If(%ARESP%)=(0) then Goto(NoMoreCommands2)
- AddVar(%ARESP%+-1=b)
- Get(%VAR%A,1,%VAR%B)
- MenuEqual(/resp=%ARESP%)
- *YNRespChecks2
- If(%RESP%)=(Y) then SetEqual(/RESP=Yes)
- If(%RESP%)=(N) then SetEqual(/RESP=No)
- ;SetEqual(/resp=%ARESP%)
- NotIf(%RESP%)=(Yes) then NotIf(%RESP%)=(No) then Goto(Question2)
- Goto(Cont2)
-
- *NoMoreCommands2
- MenuEqual(/resp=^:1^)
- SetEqual(^1=)
- Goto(YNRespChecks2)
- -----------------------------------------------------------------------
-
- The two main differences between this routine and the normal routine is
- that this one includes a "*YNRespChecks2" label, and also that you must
- put a "*Question2" directly before the prompt which asks the YesNoAsk
- question. (This is the label the routine goes to if the user does not
- enter a valid Y or N in the compound command.)
-
- -----------------------------------------------------------------------
- Say(&CR&&11&Area #%RESP%: &15&%FILNAME% &11&is now selected!&CR&)
- Jump(ST_Check2)
- *Question2
- Say(&3&Would you like to list this area? &9&[ ]&14&*)
- Back(4)
- YesNoAsk()
- *COMMAND2
- If (%RESP%)=(Yes) Then loadsub(control\macros\flist.ctl)
- -----------------------------------------------------------------------
- Note the placement of the "*Question2" label in the above example.
-
-
- EXCEPTIONS --
-
- MACROS\CHANGE.CTL : YesNoAsk Prompt
- MACROS\EXPERT.CTL : Change all "Enter" commands to
- MACROS\ABAND.CTL "If (^:1^)=() then Enter"
-
-
- MACROS\ZVIEW.CTL : There is already a "*Cont" label-- make the
- new "*Cont" label "*Cont2"
- MACROS\BYE.CTL : YesNoAsk prompt
- MACROS\COMMENT.CTL : (See Sample File)
- MACROS\NEW.CTL
- MACROS\SELFILEA.CTL
- MACROS\DOWN.CTL
- MACROS\UBATCH.CTL : "Jump(ST_CHECK)" must go BEFORE "*Fname" label
- MACROS\BATCH.CTL : "Jump(ST_CHECK)" must go AFTER "*Fname" label
-
-