User Tools

Site Tools


prepare_setup_prompt_symbols_.htm
Navigation:  Templates > Template Language Reference > Complete Alpha Listing >====== #PREPARE (setup prompt symbols) C6H0068.jpg ====== Previous pageReturn to chapter overviewNext page

#PREPARE

statements

#ENDPREPARE

blk2blue.jpg

#PREPARE Begins a prompts symbol setup section.
statements Template language statements to fix multi-valued symbols to the values needed to process the #PROMPT or #BUTTON statement preceding the #PREPARE.
#ENDPREPARE Terminates the section.

The #PREPARE structure contains Template language statements to fix multi-valued symbols to the values needed to process the #PROMPT or #BUTTON statements preceding the #PREPARE.

A #PREPARE section that precedes all the prompts is executed once, before the prompts are added to a window. In particular, if the prompts are displayed on the procedure properties screen, editing the window definition and returning does not execute the prepare code.

Example:

#CODE (SetProperty, 'Set a property on a control')

#PREPARE

 #DECLARE(%Choices),MULTI

 #DECLARE(%NextLine)

 #FREE(%Choices)

 #OPEN('property.clw'),READ

 #READ(%NextLine)

 #LOOP WHILE(%NextLine <;> %Eof)

   #! Exclude PROPLIST: properties

   #IF (SUB(%NextLine, 1, 5) = 'PROP:')

     #ADD(%Choices, SUB(%NextLine, 1, INSTRING(' ',%NextLine)-1))

   #END

   #READ (%NextLine)

 #END

 #CLOSE,READ

#ENDPREPARE

#PROMPT('Control:', FROM(%Control)),%Target

#PROMPT('Property:', FROM(%Choices)),%Selection

#PROMPT('Value:', @s255),%TargetValue

%target{%Selection} = %TargetValue

prepare_setup_prompt_symbols_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1