Arbortext Command Language > Functions by Alphabetical Listing > in_context
  
in_context
in_context (tagname[, doc[, flags]])
 
This function determines if the tag specified by tagname can be inserted at the cursor. If markup is selected, this function determines if the tag can be inserted surrounding the selected markup.
* 
If you have applied an alias map to the document, tagname can be either an alias or a real name.
The tagname string may be delimited by the start and end tag delimiters (< and >) but need not be in most cases. Special cases include the following:
"text" — Tests whether text may be inserted at the cursor.
"tab" — Tests whether a tab is valid (the latter only applies to certain document types).
If the document type has a tag named text or tag, use "<text>" or "<tag>" to test it.
The doc argument specifies the identifier of the document tree to query. If omitted or 0, the current document is used.
* 
If the document type definition for your document instance includes the NAMECASE GENERAL NO setting, then the tagname parameter will be case-sensitive.
The flags parameter is an optional bitmask 0x001, which takes auto-insertions into account (those specified by InsertAroundToFix in the .dcf file). If flags is not supplied, 0 is used.
in_context returns one of the following integers:
0 — The tag cannot be inserted.
1 — The tag can be inserted.
2 — The tag can be inserted after modifications. For example, after adding required tags.