Macro Language Reference > PIs > Text > <?find>
  
<?find>
Description
The <?find> command will retrieve format environment information from other items that appear near the current formatting position. The command permits this action to be performed during an ongoing format operation.
 
Example 457. Find specific anchored frames in the current document
The example below finds the first and then the second anchored frame in the document:
<?find 0,0,0,0,0,"*">
The example below finds the second anchored frame in the document:
<^?find 0,0,0,0,^(v21679+1),"*">
 
Example 458. Find first occurrence of a named anchored frame on or past current page
The example below finds the first anchored frame with group name cars that is on or past the current page:
<^?find 1,^(g),0,0,0,"cars">
Syntax
<?find type:n ( anchor param:L start page:n from left:n from top:n start index:n anchor or group:s )>
type
Identifies the type of information to be retrieved.
0
Anchored frames: information on frames with a certain anchor name
1
Grouped frames: information on frames with a certain anchor group name
anchor param
Each supported code can have a different number of parameters, type 0 and type 1 process the 5 parameters listed below.
start page
The page number from where to start the search: the default value is the contents of getvar 21676(result 1 of last <?find>)
from left
The horizontal position from where to start the search, in deci-microns: the default value is the contents of getvar 21677(result 2 of last <?find>)
from top
The vertical position from where to start the search, in deci-microns: the default value is the contents of getvar 21678 ((result 3 of last <?find>)
start index
The index number to start searching from: defaults to the contents of getvar 21679(result 4 of last <?find>)
anchor or group
type 0
Anchor name: find placed anchor frames with this anchor name. Can contain the wildcard characters * and?.
type 1
Group name: find placed anchor frames with this anchor group name. Can contain the wildcard characters * and?.
Additional Information
The result of the <?find> operation are then returned in these getvars, overwriting the results from the previous operation:
21675
0=not found or 1=found
21676
Page on which the frame was found
21677
Top position of the frame, in deci-microns
21678
Bottom position of the frame, in deci-microns
21679
Index position of found frame
 
These getvar numbers are reserved for the result of <?find>.
When a tformat operation is carried out, details of all anchored frames in the formatted range of pages are extracted and kept in a list. This list is sorted into priority order before formatting begins. When an anchored frame is actually placed, the list is updated with its page and position.
The <?find 0,...> and <?find 1,...> commands will search this list for placed anchored frames.
 
This effectively means that <?find 0,...> and <?find 1,...> are only useful during a tformat operation.
The first frame in the list is index position 0. You can start the find at any index position (usually one past the last found position). You can also restrict your search to only find anchored frames at, or past, a certain horizontal position and/or vertical position and/or page.
For more information, see Reference Chapter: System Variables.
Related Links