User Tools

Site Tools


conditional_source_line_.htm
Navigation:  Templates > Template Language Reference > Complete Alpha Listing >====== #? (conditional source line) C6H0068.jpg ====== Previous pageReturn to chapter overviewNext page

#?statement

blk2blue.jpg

#? Defines a single line of source code generated only if #RELEASE commits the conditional source section.
statement A single line of target language code. This may contain template symbols.

The #? statement defines a single line of source code that is generated only if a #RELEASE statement is encountered. This allows empty unnecessary “boiler-plate” code to be easily removed from the generated source.

A #EMBED that contains source to generate performs an implied #RELEASE. Any generated source output also performs an implied #RELEASE. Therefore, an explicit #RELEASE statement is not always necessary. The #? statement defines an individual conditional source line that does not perform the implied #RELEASE. When a #RESUME is executed without the output to the file being released, any conditional lines of code are un-done back to the matching #SUSPEND.

Example:

ACCEPT                        #!Unconditional source line

#SUSPEND

#?CASE SELECTED()           #!Conditional source line

 #FOR(%ScreenField)

   #SUSPEND

#?OF %ScreenField           #!Conditional source line

   #EMBED(%ScreenSetups,'Control selected code'),%ScreenField

   #RESUME

#?END                       #!Conditional source line

#RESUME

#SUSPEND

#?CASE EVENT()              #!Conditional source line

 #SUSPEND

 #?OF EVENT:AlertKey         #!Conditional source line

   #SUSPEND

  #?CASE KEYCODE()          #!Conditional source line

     #FOR %HotKey

       #RELEASE

  #?OF %HotKey              #!Conditional source line

     #EMBED(%HotKeyProc,'Hot Key code'),%HotKey

     #ENDFOR

  #?END                     #!Conditional source line

   #RESUME

#?END                       #!Conditional source line

#RESUME

END                           #!Unconditional source line

See Also:     #SUSPEND ,#RELEASE ,#RESUME

conditional_source_line_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)