snvalid

(snvalid symbol_name [flag])

The snvalid function tests whether an entry in a symbol table of a drawing database has valid characters.

Symbol tables of a drawing database include BLOCK, LAYER, LTYPE, GROUP, STYLE, DIMSTYLE, UCS, VIEW, VPORT, and APPID.

A null string is not a valid name in symbol tables.

In addition, the control and graphic characters (, ; : ' " * = / \ < > ?) are not allowed in symbol names. The vertical bar character (or pipe character: | ) is allowed for symbol table names of externally referenced drawings. The vertical bar character cannot be the first or last character.

Arguments

symbol_name specifies the name of the table entry to check.

flag controls whether the vertical bar character ( | ) is valid. The flag argument is either 0 or 1. The flag 1 accepts the vertical bar character in the symbol name, and the flag 0 does not. The flag argument is optional and defaults to 0.

Return Value

The function returns T if the symbol name is valid; otherwise, it returns nil.

 Note: Prior to the DWG2000 drawing format, a symbol table name was valid if it contained no more than 31 characters. Characters had to be alphanumeric (A - Z, 0 - 1), or could be one of the special characters dollar sign ($), hyphen (-), or underscore (_).

Examples

: (snvalid "?")

nil

: (snvalid "MYLAYER")

T

Related Functions

tblseach, tblnext