#AT (insert code in an embed point) 

Top  Previous  Next

 

#AT( location[, instances ] )[, WHERE(expression) ] [, AUTO ] [, PRESERVE ] [, DESCRIPTION(text) ]

[, PRIORITY( number )] [, FIRST ] [, LAST ]

  statements

#ENDAT

#AT

Specifies a location to generate statements.

location

An #EMBED identifier. This may be a #EMBED for a procedure that comes from another template set.

instances

The location parameters that identify the embedded source code point for a multi-valued #EMBED identifier. There may as many instance parameters as are required to explicitly identify the embedded source code point. These instances are omittable.

WHERE

More closely specifies the #AT location as only those embed points where the expression is true.

expression

An expression that specifies exact placement.

AUTO

Opens a new scope for the #AT. This means that any #DECLARE statements in the #AT would not be available to the #PROCEDURE being generated.

PRESERVE

Preserves the current fixed instances of all built-in multi-valued symbols when the #AT is called and restores all those instances when the #AT code terminates.

DESCRIPTION

Specifies text that will be displayed at the embed tree node specified by the location.

PRIORITY

Specifies the order inwhich the #AT is generated into the location. The lowest value generates first. If omitted, the PRIORITY is assumed to be 5000.

number

An integer constant in the range 1 to 10000.

FIRST

Equivalent to PRIORITY(1).

LAST

Equivalent to PRIORITY(10000).

statements

Template and/or target language code.

#ENDAT

Terminates the section.

The #AT structure specifies a location to generate statements. #AT is valid only in a #CONTROL, #CODE, or #EXTENSION templates, and is used to allow them to generate statements into multiple locations. The #AT structure must terminate with #ENDAT.

The WHERE clause allows you to create an expression that can specify a single specific instance of a #EMBED that has a symbol attribute. You may not place #AT within any type of conditional structure (such as #IF or #CASE). If you need to conditionally generate the code, place the #IF or #CASE structure within the #AT structure.

Example:

#CONTROL(BrowseList,'Add Browse List controls')

#AT(%ControlEvent,'?Insert','Accepted'),PRIORITY(5000)

   #IF(%InsertAllowed)

GlobalRequest = InsertRecord

%UpdateProc

   #ENDIF

 #ENDAT

#!

See Also:     #EMBED , #CODE , #CONTROL , #EXTENSION , #RESTRICT