#QUERY (conditionally generate source)

Top  Previous  Next

 

#QUERY( section, source )

#QUERY

Generates source if the named #SUSPEND section has been released.

section

The name of the #SUSPEND section to #QUERY.

source

The code to generate.

The #QUERY statement conditionally generates its source based on whether the named #SUSPEND section has been released (either explicitly or implicitly). If the #SUSPEND section has been released then #QUERTY generates its source, without affecting the release of any other nested #SUSPEND section it may be in--it does not create an implict #RELEASE.

Example:

#SUSPEND(Fred)       #!Begin suspended generation section named "Fred"

#?1

#SUSPEND             #!Begin unnamed suspended generation section

#?2

#QUERY(Fred,'3')     #!Generate "3" only if the "Fred" section is released

#?4

#RESUME

5                    #!Unconditional generation causes implicit #RELEASE of "Fred"

#RESUME              #!End "Fred" section

 

#!The above code will generate 1, 3, 5 on successive output lines

#!The 2 and 4 don't generate because the unnamed section was not released

 

See Also:     #SUSPEND