CADLMAN.TXT contains a description of programming features found in CADL,
the CADKEY Advanced Design Language. A bound version of this document with
examples accompanying each command is available from Cadkey. If you are new
to CADL programming you may also be interested in the CADL/CDE Training Kit
"Exploring CADKEY's Open Architecture." This training kit offers an
introduction for beginners covering a complete description of CADL and CDEs
(Cadkey Dynamic Extentions - Program Extensions written in C). The kit 
contains numerous examples in the text and on a sample files disk. 

Both the CADL Reference Manual and The CADL/CDE Training Kit can be
ordered directly from Cadkey using the FAX-back forms included with your
package.

Table Of Contents - CADL Reference Manual

Introduction To CADL	
CADL Guide Format	

Section One: Basics	
Using CADL	
CADL Expressions	
Program Control Statements 

Section Two: Commands
Introduction
Entity Primitives
Entity Control
Display Control
Viewport Control
View Manipulation
User Interaction
Data File Input and Output
Part and Pattern File Access
Setting System Values
Strings and Arrays
Vector Math Functions
Copious Entities
Collectives
Groups
Dialog Box Manager
Accessing CDE Modules

Section Three: Reference

Section Four: CADL Compiler
Introduction to CCOMP
CCOMP Files
Using CCOMP
Command Line Options
Compiler Directives
Compiler Specific Commands

Appendices
Appendix I: CADL Error Messages
Appendix II: System Arrays
Appendix III: Entity Information
Appendix IV: Dialog Box Errors
Appendix V: Dialog Box Entity Attributes
Appendix VI: Sample Files

______________________________________________________________________________

Introduction

The CADKEY Advanced Design Language (CADL) is a powerful 
programming language that operates within the structure of the 
CADKEY program. The flexibility of this language allows you to design 
and store your own functions and entities within CADKEY, as well as 
access the CADKEY database.

The purpose of this section is to help you understand the basic 
capabilities of the CADL language. This CADL Guide is divided into the 
following sections:

This section, Introduction to CADL, describes the various formats used 
throughout this guide.

Section One: Basics describes those elements which comprise a CADL 
program file along with any existing restrictions on their use. This 
includes register variables, CADL data types, variable declarations, 
format specifiers, math functions and program control statements..

Section Two: Commands groups all of the commands into their related 
categories and gives a brief description of each of them.  

Section Three: Reference  is an alphabetic listing of every CADL 
command, excluding compiler specific commands.

Section Four: CADL Compiler explains the use of the CCOMP utility 
and lists the commands and directives that are specific to compiled 
programs.  

The Appendices list CADL error messages, information held in the 
system arrays, dialog box errors, dialog box entity attributes, and 
includes four samples programs.

______________________________________________________________________________

CADL GUIDE FORMAT

The format used by the CADL guide follows these basic rules:

* Commands beginning with sys_ or dg_ are case-sensitive and must be 
in lower case letters, as they will appear throughout the manual.  The 
rest of the commands are not case-sensitive, but for clarity, will be 
printed in upper case.  For example:

sys_get_name

ARC

* Those parameters considered "optional" are enclosed in square 
brackets for easy reference.  

LABEL x1, y1, x2, y2, x3, y3, arrowtype, x, [pen]

* Any section of text that is in the following typeface may be taken 
directly from book and executed.  Bold text in this typeface represents 
on-screen text results. For example,


PAUSE "This can typed in directly"


will output the following line to the CADKEY prompt line:


This can be typed in directly


* An ellipses (...) found within square brackets indicates that additional 
parameters may be specified.

GENDIM form, numlines, numarcs, numarrows, arrayname, arrowtype, 
x, [...]

* Described in parenthesis next to each command parameter is a 
descriptor which indicates the type of parameter. For example:

numlines (integer)

describes numlines as the name of an integer value.  (See CADL 
Expressions for an explanation of the different types of parameters 
allowed in CADL.)

Those descriptors are explained:

(string) 	identifies a group of characters enclosed by double 
quotation marks. In an example group of characters 
such as "This is an example string", all printable 
characters, spaces and tabs are permitted. A backslash 
character (\) allows you to include some special 
characters in the string:

	\\   	backslash	\r	carriage return
	\"   	double quote	\n   	new line
	\b   	backspace	\f   	form feed
	\t	tab	        \a..z   results in that character

(word) 	identifies a group of characters delimited by white space 
or commas.

(double) 	identifies a double precision floating point value. An 
expression may also be specified, in which case the 
floating point result is used.

(integer) 	identifies an integer value. An expression may also be 
specified, in which case the integer result is used.

(val) 	identifies either a floating point or an integer value. An 
expression may also be specified, in which case the result 
is used.

(fvar) 	identifies the name of a double precision floating point 
variable.

(ivar) 	identifies the name of an integer variable.

(cvar) 	identifies the name of a character variable.

(var) 	identifies the name of either a floating point or an 
integer variable.

(farray) 	identifies name of an array of double precision floating 
point numbers. It is similar to 'word'.

(iarray) 	identifies name of an array of integers. It is similar to 
'word'.


_____________________________________________________________________________

Section One: Basics

Table Of Contents

USING CADL	        
CADL EXPRESSIONS	
Register Variables	
CADL Data Types	        
Variable Declarations	
Data Typing	        
Declaring ARRAYs	
Declaring SLISTs	
The CLEAR command	
Format Specifiers	
Input Format Specifiers	
Output Format Specifiers
Math Functions	        
PROGRAM CONTROL STATEMENTS
The REM statement
The IF statement 
Branching and Looping with Labels
Program Branching
Exiting a CADL program
Suspending CADL Execution
Calling External Programs or System Processes
Declaring the Security Code String
Compiler-Specific Control Statements


USING CADL
A CADL program file may be generated using a text editor or word 
processing program under the rules defined in this guide. Names for 
these files follow the same specifications as the system's naming 
convention, along with the addition of an extension. Specific extensions 
are discussed in their respective sections of this guide.

To execute a CADL file in CADKEY or CUTTING EDGE, use the FILES, 
CADL, EXECUTE option. Enter the name of the CADL file and press 
<Enter>. If an error is detected, CADL file processing halts and an error 
message is displayed.

For a complete listing of these error messages and their descriptions, 
refer to Appendix I.

A typical CADL file consists of variable length records delimited by new 
lines. Each of these statements directs the flow of the program. A typical 
statement represents either a primitive, command or expression, along 
with any required parameters. Please refer to the Reference section of 
this guide for detailed information on primitives, program control 
statements and commands.

CADL EXPRESSIONS
The purpose of an expression is to evaluate a mathematical statement 
and optionally store the results in a variable. Refer to Register 
Variables, found in this section, for an explanation of the different types 
of variables offered by the system.

For example:

POINT (2.0+a), 3.0, (a*b)

describes a POINT primitive with an x value assigned the results of 2 
plus the numeric value of a, a y value of 3, and a z value assigned the 
results of a times b.

Note that in a CADL program, an expression terminates at the end of a 
line unless a backslash(\) is found. When this is the case, the command 
is continued on the following line. For example:

n = sqrt(a*b)+\
sin(angle)*2*\
(x+y+z)

This equation is evaluated as n = sqrt(a*b)+sin(angle)*2*(x+y+z). The 
backslash (\) must be the last character in the line, immediately 
preceding the <Enter>.

The following rules apply to CADL expressions. There are three types of 
constants, as listed below.

Integer Constants XE "Integer Constants" 

A decimal integer is a sequence of digits 0 - 9. If the first digit is a 
0, the integer is taken as an octal (base 8) value. In this case only 
digits 0 - 7 are valid. If the sequence is preceded by the prefix 0x or 
0X, the integer is taken as a hexadecimal (base 16) value. In 
addition to 0 - 9, hexadecimal digits also include the characters a-f 
(upper or lower case) corresponding to the values 10 - 15 
respectively.

Float Constants XE "Float Constants"  

A float constant consists of a signed integer part, a decimal point, 
a fractional part, an E (or e), and a signed integer exponent. Either 
the integer part or the fractional part may be omitted, but not 
both. Either the decimal point or the E (or e) with exponent may be 
omitted, but not both.

String Constants XE "String Constants" 

A string constant is a sequence of characters enclosed in quotes, 
such as "this is a string". All strings are treated as an array of 
characters and are automatically terminated by the null character 
(ASCII value 0). Thus, the string "hello" actually contains six 
characters. A special character sequence is provided to denote 
control characters and characters outside of the ASCII range. The 
sequence is signaled by a backslash(\) character. When detected, 
the next character is interpreted as shown below. For characters 
not listed, the character itself is used. This provides a way of 
entering characters which normally have a special meaning (e.g., 
use \\ for the \ character, \" for ", etc.)

	\b  backspace	\f  formfeed
	\n  newline	\r  carriage return
	\t   tab

In addition to the above characters, an octal value may be entered by 
following the \ character with a three digit octal number (e.g., \263). 
Also, a hexadecimal value may be entered by following the \ character 
with the character x and two hexadecimal digits (e.g., \x85). For an octal 
value the permissible range is \000 - \377; for a hexadecimal the range 
is \x00 - \xff.

Most of the operators recognized by the expression evaluator are 
equivalent to their counterparts in the 'C' programming language (those 
which are different are marked with a *). The list is as follows:

Math Operators XE "Math 
Operators" 

a + b	        addition
a - b   	subtraction
a * b   	multiplication
a / b   	division
a ^ n   	nth power of a*
(a)     	precedence
a[n]    	array index
-a      	negative a
+a      	positive a
a'      	feet*
a"      	inches*
a % b 	        a (integer) modulus b
xxx = b 	numeric 

variable assignment
$msg="hello"	        string variable assignment
$$msg[x] = "world"	slist element assignment
a=1.5                   double floating point assignment
b=1                     integer (stored as double) assignment

Logical Operators
 XE "Logical Operators" 
a == b       	equal comparison
a != b       	not equal comparison
a > b        	greater than comparison
a < b        	less than comparison
a >= b      	greater than or equal to comparison
a <= b       	less than or equal to comparison
a && b       	AND operation
a || b       	OR operation 
(a) ? x : y  	conditional

Bitwise Operators
 XE "Bitwise Operators" 
a | b     	a ORed with b
a & b     	a ANDed with b
a # b     	a XORed with b*
a >> b    	a shifted right by count of b
a << b    	a shifted left by count of b 
~a        	complement

Algebraic operations are prioritized, as with BASIC, FORTRAN, C and 
most programming languages. The precedence of operators XE 
"precedence of operators" , listed below, is grouped by operator type. The 
group header indicates whether the operators are processed from left to 
right or vice versa. The list is arranged from higher to lower precedence 
with operators on the same line having equal precedence. Note that ' 
(feet) and " (inches) are actually special unary operators.

Primary-expression operators (left->right) ()	[] 	
        functions (cos, sqrt, sizeof, etc.)
	Unary operators  (right->left)
		+	-	~
	'  	"
	Binary operators (left->right)
	^
	*  	/  	%
	+  	-
	>>  	<<
	<	>	<=	>=
	==  	!=
	&
	#
	|
	&&
	||
	?:
	Assignment operator (right -> left)
	=

Operation Examples

Example 1:

Statement:	x = 4 / 10 * PI + cos(45)
Result:	variable x is assigned the value 1.963744

Example 2:

Statement:	x = (y = 23 / 5) + (z = @depth)
	(where @depth = 0)
Results:	variable x is assigned the value 4.6
	variable y is assigned the value 4.6
	variable z is assigned the value of system variable 
@depth which,
	 in this case, equals zero.

Example 3:

Statement :	$msg = "Hello"
Results:	The string variable $msg is created with an array size of 
6 and contains the characters "Hello" followed by a null 
terminating character. This is equivalent to the 
statement:

array $msg[6] = {72, 101, 108, 108, 111, 0}

Register Variables

Variables may substitute a constant numeric value anywhere in a CADL 
program file (e.g., primitives, commands or expressions), including 
when specifying an array size.

There are two types of variables offered, a variable set by the user, and a 
system variable maintained and updated by the system.

Rules for Register Variables XE "Register Variables" 

1) 	The system register database recognizes and stores floating point 
(double precision) numeric values only, even if an integer 
constant was initially assigned.

2) 	Variables may be assigned a name consisting of any number of 
characters, however only the first eight are used (any extra 
characters are ignored). The first character of a variable name 
must begin with an alpha character. The remaining characters 
may be any combination of alphanumeric and underscore (_) 
characters. Upper and lower case differences are observed.

3)	Arrays may be used if they have been previously initialized with 
the ARRAY statement.

4) 	The maximum number of variables which may be assigned at one 
time is definable using the configuration program. An arrayname 
counts as one variable name.

5)	A number of reserved variables are maintained and updated by 
the system. They are accessible through CADL as read-only.  These 
variables must always begin with the @ character. System 
variables XE "System Variables"  are case insensitive. The current 
list is as follows:


@cdldev	-	CADL input device number
@cdlname[] 	- 	name of most recently accessed CADL filename 
@cdlpath[] 	- 	directory path of CADL files
@cid	-	ID of currently accessed copious entity
@color 	- 	current color
@const 	- 	current system status of 2D/3D construction switch
@csize	-	size of currently accessed copious entity
@ctcode	-	type code of currently accessed copious entity
@curvp	-	current viewport
@cview	-	current construction view number
@cwd[]	-	current working directory path
@cviewmat[9]	-	current construction view matrix
@depth 	- 	current depth setting
@dflt 	- 	last value entered on the prompt line
@dimfill	-	current dimension text fill mode
@dimfont	-	current dimension text font number
@dimht 	- 	current system text height for dimensions
@diminfo1[] 	- 	array used by some CADL functions to return 
                integer data for the dimension entity
@diminfo2[] 	- 	array used by some CADL functions to return 
                floating point data for the dimension entity
@dimscale 	- 	current system dimension scale
@dimslnt	-	current dimension text slant angle
@entatt[] 	- 	array used by some CADL functions to return 
                attributes for the entity 
@error 	- 	CADL/calculator error number
@fltdat[] 	- 	array used by some CADL functions to return 
                floating point data
@intdat[] 	- 	array used by some CADL functions to return 
                integer data
@key 	- 	character code for last key hit
@lastid	-	ID number of last entity added to database
@lastvw 	- 	number of the last view added to the database
@ldrln[][] 	- 	array used by some CADL functions to return data 
                for the leader line
@level 	- 	current system level
@levels[]	- 	displayed levels array mask
@ltype 	- 	current line type
@lwidth 	- 	current line width
@mscdat[]	-	array used by some CADL functions to return 
                miscellaneous data
@noteang 	- 	current system note text angle
@notefill	-	current note text fill mode
@notefont	-	current note text font number
@noteht 	- 	current system text height for notes
@noteline	-	current note text line spacing factor
@noteslnt	-	current note text slant angle
@noteuln	-	current note text underline mode
@notpath[]	-	directory path of note files
@nread 	- 	number of data items read with last CADL READ command
@numflt 	- 	number of items currently in @fltdat array
@numint 	- 	number of items currently in @intdat array
@numpal 	- 	number of palette colors supported by graphics 
                controller
@numstr	-	number of items currently in @strdat array
@numvp	-	current number of graphic viewports
@palb[256] 	- 	current system color palette BLUE values, where:
		@palb[n] = BLUE value (between 0 and 255) for 
                color palette index n
@palg[256] 	- 	current system color palette GREEN values, where:
		@palg[n] = GREEN value (between 0 and 255) for 
                color palette index n
@palr[256] 	-	 current system color palette RED values, where:
		@palr[n] = RED value (between 0 and 255) for color 
                palette index n
@pen 	- 	current pen value
@pltname[] 	- 	name of most recently accessed plot filename
@pltpath[]	-	directory path of plot files
@prtname[] 	- 	name of most recently accessed part filename 
@prtpath[]	-	directory path of part files
@ptnname[] 	- 	name of most recently accessed pattern filename
@ptnpath[]	-	directory path of pattern files
@refarc[][] 	- 	array used by some CADL functions to return data 
                for the reference arc
@refln[][] 	- 	array used by some CADL functions to return data 
                for the reference line
@refpnt[][] 	- 	array used by some CADL functions to return data 
                for the reference point
@scale 	- 	current system viewing scale
@selpval	-	parameter value of marker position on selected 
entity
@selsnum	-	segment number of marker position on selected 
entity
@sfpath[]	-	directory path of scratch files
@strdat[] 	array used by some CADL functions to return string data
@suppath[]	-	directory path of support files
@txtasp	- 	current system text aspect ratio for note and dimension text
@txtatt[] 	- 	array used by some CADL functions to return 
                attributes for the dimension text 
@txtinfo[] 	- 	array used by some CADL functions to return 
                integer data for the dimension text
@units 	- 	current system units mode, English or Metric
@versel	-	current verify selection mode
@view 	- 	current system view number
@viewmat[9]	-	current view matrix
@vwwld 	- 	current system status of view/world switch
@xcursor 	- 	current X cursor location
@xcview	-	last X coordinate value returned by the Position 
Menu (construction view coordinates)
@xmax 	- 	X max coordinate of current viewport window
@xmin 	- 	X min coordinate of current viewport window
@xview	- 	last X coordinate value returned by the Position 
                Menu (view coordinates)
@xworld 	-	last X coordinate value returned by the Position 
                Menu (world coordinates)
@ycursor 	- 	current Y cursor location
@ycview	-	last Y coordinate value returned by the Position 
                Menu (construction view coordinates)
@ymax 	- 	Y max coordinate of current viewport window
@ymin 	- 	Y min coordinate of current viewport window
@yview 	- 	last Y coordinate value returned by the Position 
                Menu (view coordinates)
@yworld 	- 	last Y coordinate value returned by the Position 
                Menu (world coordinates)
@zcview	-	last Z coordinate value returned by the Position 
                Menu (construction view coordinates)
@zview 	- 	last Z coordinate value returned by the Position 
                Menu (view coordinates)
@zworld 	- 	last Z coordinate value returned by the Position 
                Menu (world coordinates)
@1-@10 	- 	numeric values currently displayed on the  prompt 
                line, in order of their appearance


CADL Data Types

There are various types of data that need to be represented in a program. 
In the previous versions, CADL supported a single data type, the 
floating point, in the range of -10^308 to 10^308 and a precision of as 
many as 15 digits.

Two other data types, integer and character, are obtained by using the 
floating point. Whenever a value is used in integer operations, the value 
is truncated or rounded to the nearest integer value. Similarly, if a 
character is divided by 256, the remainder is used as the ASCII value of 
the character.

Now, in addition to the above mechanism, CADL supports more data 
types.  However, if a variable is not defined, it will now be considered a 
double.

The abstract data types supported by CADL are as follows:

char
 XE "data types:char" a single character

Example: 
char letter, digit
letter = 'A'
digit = '9'

double XE "data types:double" 
double precision floating point data

Example: 	
double x, y
x = 1.00
y = 2.12345678998765432

float XE "data types:float" 
floating point data

Example:
float x, y
x = 2.0
y = 10.5

int XE "data types:int" 
integer

Example: 
int x, y
x = 1
y = 10

long XE "data types:long" 
long integer

Example: 	
long x, y
x = 39123
y = 5549

short XE "data types:short" 
short integer

Example: 
short x, y
x = 1
y = 5

slist XE "data types:slist" 
array of strings of characters

Example: 
slist $$xyz[0]
$$xyz[0] = "menu1"

string XE "data types:string" 
array of characters

Example: 	
string $title
$title = "menu1" 

uchar XE "data types:uchar" 
unsigned character

Example: 	
uchar c
c = 'a'

uint XE "data types:uint" 
unsigned integer

Example: 
uint x
x = 25

ulong XE "data types:ulong" 
unsigned long integer

Example: 	
ulong x
x = 62234


ushort XE "data types:ushort" 
unsigned short integer

Example: 
ushort x
x = 8

Variable Declarations
 XE "Variable Declarations" 

Data Typing

When you use a variable for the first time and have done no data 
typing XE "Data Typing Variables"  to it, it is assumed to be a double 
precision variable.  However, if you wish to create a variable of any 
other type (i.e., int, char, etc.) you must data type it in the following 
manner:

data-type var1 [, var2, ... ]

For example:

int x, y, z

This statement declares x, y, and z as integer variables.  They will remain 
typed as integers until you use the CLEAR command on them or quit 
CADKEY or CUTTING EDGE.  You cannot change the data type of a 
variable once it has been typed unless you use the CLEAR command and 
then retype it.

To data type arrays, you use the same format as above.  The only 
difference is shown in the following example:

int pts[0]

This line types the array, pts, as an integer array.  If an array is not data 
typed, it will default to an array of doubles. The zero enclosed by 
brackets after the arrayname on the data type line signifies that 
arrayname will be later declared as an array.  This is not the actual 
declaration.  To use the array, you still must use the ARRAY declaration.  
This line merely states that when arrayname is declared, it will be an 
array of the data type you specified.  


Declaring ARRAY XE " ARRAY" s

Arrays allow data to be assigned to a single or multi-dimensional storage 
array within a CADL program. Data may be assigned to an array 
anywhere within a CADL file, as long as it is assigned before the array is 
used. The limit to the number of dimensions in an array is five. 


Use the following formulas to calculate the maximum size for two to 
five dimensional arrays:

Two-dimensional arrays: 	( i, j )	i / 2 + i * j <= maximum
Three-dimensional arrays: 	( i, j, k )	i * j / 2 + i * j * k <= 
maximum
Four-dimensional arrays:	( i, j, k, l )	i * j * k / 2 + i * j * k * l <= 
maximum
Five-dimensional arrays:	( i, j, k, l, m )	i * j * k * l  / 2 + i * j * k * l * m <= 
maximum

To declare an array, you must use one of the following formats:

Format 1:	ARRAY arrayname[n]={n1, n2, n3...}     

Format 2:	ARRAY arrayname[n]
	..
	arrayname[0] = n1
	arrayname[1] = n2
	..


To declare an array, you must use ARRAY, followed by the array's name.  
Following the arrayname on the line is a number enclosed in square 
brackets, representing the dimensional size. Up to five sets of brackets 
may be used.  One set of brackets represents a single-dimensional array; 
two sets represent a two-dimensional array; three sets represent a three-
dimensional array.  The size of the array can also be specified using a 
variable.

Once you've declared the array, you can set the elements of the array on 
the same line by following the dimension size(s) with an equals sign (=) 
and then a list of the elements, separated by commas and surrounded by 
curly braces { } (See Format 1).  When using this type of initialization for 
arrays, the elements in the list must be numeric values; they cannot be 
variables or expressions.  For multi-dimensional arrays, data is stored by 
switching the last dimension first, and then continuing up to the first 
dimension. (See Array Declaration Examples.)  

If you don't wish to set the array initially, but would rather set it later in 
your program, you may assign values to the array elements by using 
Format 2. When assigning values to array elements in this fashion, the 
elements may be assigned with variables along with numeric values.  
Note that when you are setting the values of an array, the elements are 
numbered from 0 to (n-1), NOT from 1 to n.

You can declare an array even if it has already been declared once.  You 
can change the size of each dimension and even the number of 
dimensions; however, by doing this, you will lose all the data that you 
previously stored in the array.


Array Declaration Examples
 To define a one-dimensional array of five values, either of the following 
formats will create the same array: 

int data [0]
ARRAY data [5] = {0, 1, 2, 3, 4}

int data [0]
ARRAY data [5]
data [0] = 0
data [1] = 1
data [2] = 2
data [3] = 3
data [4] = 4
 
To define a two-dimensional array of three rows and two columns, both 
of the following formats will create the same array: 

int data [0]
ARRAY data [3][2] = {0, 1, 2, 3, 4, 5}

int data [0]
ARRAY data 
[3][2]
data [0][0] = 0
data [0][1] = 1
data [1][0] = 2
data [1][1] = 3
data [2][0] = 4
data [2][1] = 5



To define a three-dimensional array of three rows, two columns, and two 
planes, you can use either of the following: 

int data [0]
ARRAY data 
[3][2][2] = {0, 
1, 2, 3,\                  
                        
4, 5, 6, 7,\
                        
8, 9, 10, 11} 
	 

int data [0]

ARRAY data [3][2][2] 
data [0][0][0] = 0
data [0][0][1] = 1
data [0][1][0] = 2
data [0][1][1] = 3
data [1][0][0] = 4
data [1][0][1] = 5

data [1][1][0] = 6
data [1][1][1] = 7
data [2][0][0] = 8
data [2][0][1] = 9

data [2][1][0] = 10
data [2][1][1] = 11

Declaring SLISTs

The SLIST data type XE "data types:slist"  is very similar to an array 
except that it is only a single dimensional list of strings.  To declare an 
SLIST, use the following format:


SLIST $$listname[numstrings][maxlength]


You can specify the number of strings in the list and the maximum size 
of every string in that list.  If either numstrings or maxlength is set to 
zero(0), that field is assumed to be of variable size.

Unlike an ARRAY declaration, you cannot initialize an SLIST.  You must 
set every item in the SLIST separately.  For example:

SLIST $$parts[0][0]
$$parts[0] = "nut"
$$parts[1] = "bolt"
$$parts[2] = "screw"


The CLEAR  XE "CLEAR " command

When you declare a variable, that variable remains in variable buffer 
until you quit the program or use the CLEAR command.  The CLEAR 
command will remove a specified variable from the variable buffer 
space.  If CLEAR is used without any parameters, it will remove all 
variables from the variable buffer space.  For example:

CLEAR x, y

This line will remove the variables x and y from the variable buffer 
space.  

It is a good programming practice to CLEAR all variables you have used 
at the end of your program.  This practice ensures that none of your 
variables will have any effect on another program which may later be 
executed.  For example, if you type cast the variable num as type integer, 
and then don't CLEAR it at the end of your program, the next program 
you run may try to type cast  num as a char type, and will receive an 
error.


Format Specifiers
 XE "Format Specifiers" 
The format-string controls the interpretation of the input fields and is 
read from left to right. Characters that fall outside format specifications 
are expected to match the sequence of characters in the input stream; 
the matched characters are scanned but not stored. If a character in the 
input stream conflicts with the format-string, the specifier input 
terminates. The conflicting character is left in the stream as if it had not 
been read.

When the first format specification is found, the value of the first input 
field is converted according to the format specification and stored in the 
location specified by the first argument. The second format specification 
causes the second input field to be converted and stored in the second 
argument. This process continues through the end of the format-string.

An input field is defined as all characters up to the first white-space 
character (space, tab, or new line), or up to the first character that 
cannot be converted according to the format specification, or until the 
field width, if specified, is reached, whichever comes first. If there are 
too many arguments for the given format specifications, the extra 
arguments are ignored. An error is generated if there are not enough 
arguments for the given format specifications. The format-string can 
contain one or more of the following:

 -	White-space characters (blank (' '), tab ('\t'), or new line ('\n')). A 
white-space character causes input to read, but not store, all 
consecutive white-space in the input up to the next non white-space 
character. One white-space character in format-string matches any 
number (including 0) and combination of white-space characters.

 -	Non white-space characters, except for the percent-sign character (%). 
A non white-space character causes input to read, but not store, a 
matching non white-space character. If the next character in the input 
stream does not match, input terminates.

 -	Format specifications, introduced by the percent sign (%). A format 
specification causes input to read and convert characters into values 
of a specified type. The value is assigned to an argument in the 
argument list.


Input Format Specifiers XE "Input Format Specifiers"  XE "Format 
Specifiers:Input" 

The input format specifier is as follows:

%[*][width]type

Each field of the format specification is a single character or a number 
signifying a particular format option.

* 	an asterisk following the percent sign suppresses assignment 
of the next input field, which is interpreted as a field of the 
specified type. The field is scanned but not stored.

width 	is a positive decimal integer controlling the maximum 
number of characters to be read from the stream. No more 
than width characters are converted and stored at the 
corresponding argument. Width characters may be read if a 
white-space character (space, tab, or new line) or a character 
that cannot be converted according to the given format 
occurs before width is reached.

type	is a character which appears after the last optional format 
field. This determines whether the input field is interpreted 
as a character, a string, or a number. The simplest format 
specification contains only the percent sign and a type 
character (for example, %s).
	If a percent sign (%) is followed by a character that has no 
meaning as a format-control character, that character and 
the following characters (up to the next percent sign) are 
treated as an ordinary sequence of characters - that is, a 
sequence of characters that must match the input. For 
example, to specify that a percent sign character is to be 
input, use %%.

The type characters and their meanings are described as follows:
    
d 	represents a decimal integer input with an integer argument.

o 	represents an octal integer input with an integer argument.

x 	represents a hexadecimal integer input with an integer 
argument.

i 	represents a decimal, hexadecimal or octal integer input with an 
integer argument.

u 	represents an unsigned decimal integer input with an integer 
argument.

e and f	represent floating-point values consisting of an optional sign (+ 
or -), a series of one or more decimal digits possibly containing a 
decimal point, and an optional exponent ("e" or "E") followed by 
an optionally signed integer value with a float argument type.

c 	represents a character. White-space characters that are 
ordinarily skipped are read when c is specified; to read the next 
non-white space character, use %1s. A character argument type 
is used.

s 	represents a character string.

To read strings not delimited by space characters, a set of characters in 
brackets ([]) can be substituted for the s (string) type character. The 
corresponding input field is read up to the first character that does not 
appear in the bracketed character set. If the first character in the set is a 
caret (^), the effect is reversed: the input field is read up to the first 
character that does appear in the rest of the character set.
Output Format Specifiers XE "Format Specifiers:Output" 
 XE "Output Format Specifiers" 
The pause, prompt, print, or sprint format specifier is a single character 
or number representing a particular format option. The format followed 
by a specifier is as follows:

%[flags][width][*precision]type

Each parameter is described:

Type is a character which appears after the last optional format 
field. This character tells to the program whether a character, string 
or number is being used. This type character may be used with the 
percent sign alone at any time (e.g., %f).

Those other fields listed in the format above are optional. A full 
description of each is described in their section headings.  Each is briefly 
described here:

Type characters supported are:

d	represents an integer type with an output format of a signed 
decimal integer.

u 	represents an integer type with an output format of an unsigned 
decimal integer.

o 	represents an integer type with an output format of an unsigned 
octal integer.

x 	represents an integer type with an output format of an unsigned 
hexadecimal integer, using the characters 0-9 and a-f.

f 	represents a floating point type with a signed value having the 
form [-]dddd.dddd, where dddd is one or more decimal digits. 
The number of digits before the decimal point depends on the 
magnitude of the number, and the number of digits after the 
decimal point depends on the requested precision.

e 	represents a floating point type with a signed value having the 
form [-]d.dddd e [sign]ddd, where d is a single decimal digit, 
dddd is one or more decimal digits, ddd is exactly three decimal 
digits, and sign is + or  -.

g 	represents a floating point type with a signed value printed in "f" 
or "e" format, whichever is more compact for the given value 
and precision (see below). The "e" format is used only when the 
exponent of the value is less than -4 or greater than precision.  
Trailing zeros are truncated and the decimal point appears only 
if one or more digits follow it.

c 	represents a character with an output format of a single 
character.

s 	represents a string with an output format of characters printed 
up to the first null character ('\0') or until precision is reached.


Flags justify the output and printing of signs, blanks, decimal points, 
octal and hexadecimal prefixes. More than one flag can appear in a 
format specification.
Flag characters supported are:

- 	left justifies the result within the field width (default is right 
justify).

+ 	prefixes the output value with a + or - sign if the output value is 
of a signed type (default is when sign appears only for negative 
signed values).

(' ')	 (blank) prefixes the output value with a blank if the output 
value is signed and positive; the "+" flag overrides the blank flag 
if both appear, and a positive signed value will be output with a 
sign (default is no blank).

# 	used with the o or x format, the "#" flag prefixes any non-zero 
output value with 0, or 0x respectively (default is no prefix).

	Used with e format, the "#" flag forces the output value to 
contain a decimal point in all cases (default is decimal point 
appears only if digits follow it).

	Used with g format, the "#" flag forces the output value to 
contain a decimal preventing the truncation of trailing zeros.  
Ignored when used with c, d, u, or s types (default is decimal 
point appears only if digits follow it). Trailing zeros are 
truncated.

Width describes the minimum number of characters output.

	The width (non-negative decimal integer) controls the number of 
characters printed. If the number of characters in the output 
value is less than the specified width, blanks are added on the 
left or the right (depending on whether the "-" flag is specified) 
until the minimum width is reached. If width is prefixed with a 
0, zeros are added until the minimum width is reached (not 
useful for left-justified numbers).

	The width specification never causes a value to be truncated; if 
the number of characters in the output value is greater than the 
specified width, or width is not given, all characters of the value 
are printed (subject to the precision specification).


Precision describes the maximum number of characters printed for all or 
part of the output field, or minimum number of digits printed for integer 
values.

The precision specification is a non-negative decimal integer preceded by 
a period (.) which specifies the number of characters to be printed, or the 
number of decimal places. Unlike the width specification, the precision 
can cause truncation of the output value, or rounding in the case of a 
floating point value.
 
	The interpretation of the precision value and the default when precision is 
omitted depends on the type: 

d/u/o 	Precision specifies the minimum number of digits to be printed. 
If the number of digits in the argument is less than precision, the 
output value is padded on the left with zeros. The value is not 
truncated when the number of digits exceeds precision.

	If precision is 0 or omitted entirely, or if the period (.) appears 
without a number following it, the precision is set to 1.

e 	The precision specifies the number of digits to be printed after 
the decimal point. The last printed digit is rounded.

	Default precision is six; if precision is 0 or the period (.) appears 
without a number following it, no decimal point is printed.

g 	The precision specifies the maximum number of digits printed.
 
c 	No effect. The character is printed.

s 	The precision specifies the maximum number of characters to be 
printed.      

If a percent sign (%) precedes a character that has no relation to the 
form field, the character is copied out to output. In other words, a 
percent sign may be printed as a character by typing %%.

Characters are printed until a null character is encountered.
Math Functions
 XE "Math Functions" 
Following is a list of functions which are offered by the system and may 
be used in an expression to replace a constant numeric value.


abs XE "ABS" (x)

Returns the absolute value of a number, x.

Argument: 
	x can be any constant value, an assigned variable, or an 
expression.

Example:
	x = -2
	y = abs(x)
	(y will be equal to 2)

Error:
	none


acos XE "ACOS" (x)

Returns the arc cosine of x, in the range of 0 to 180 degrees.

Argument:
	The value of x must be between -1 and +1.

Example: 
	y = acos(0.862)
	(y will be equal to 30.4581)

Error:	
If the value of x is outside the allowed domain, the error 
message 'acos: DOMAIN error' is displayed.


asin XE "ASIN" (x)

Returns the arc sine of x in the range between -90 and +90 
degrees.

Argument:
	The value of x must be between -1 and +1.

Example:
	y = asin(0.65)
	(y will be equal to 40.5416)

Error:
If the value of x is outside the allowed domain, the error 
message 'asin : DOMAIN error' is displayed.


atan XE "ATAN" (x)

Returns the arc tangent of x in the range between -90 and +90 
degrees.

Argument:
	x may be any constant value or an assigned variable.

Example:
	y = atan(17)
	(y will be equal to 86.6335)

Error:
	none


atan2 XE "ATAN2" (y, x)

Returns the arc tangent of y/x in a range between -180 and +180 
degrees.

Arguments:
	Any two values, with the exception that they are not 
both equal to zero.

Example:
	y = atan2(2, 3)
	(y will be equal to 33.6901)

Error:
If the values of x and y are both 0, the error message 
'atan2 : DOMAIN error' is displayed.



ceil XE "CEIL" (x)

Returns the value of x rounded up to the nearest integer (the 
integer ceiling).

Argument:
	x can be any value.

Example:
	y = 5.84
	x = ceil(y)
	(x will be equal to 6)

Error:
	none


copsize XE "COPSIZE " (type)

Returns an integer representing the size of a specified copious 
entity item. A value of zero is returned for any undefined 
constant.

Argument:
	type can be any one of the following constants (either 
upper or lowercase letters may be used):

char    - character 
uchar   - unsigned  character
int     - integer 
uint    - unsigned  integer
short 	- short integer
ushort  - unsigned  short
long	- long integer
ulong	-  unsigned long
float	- float
double	-  double
tcode 	-  copious entity type code


Example:
	s = copsize (long)
	(s will be equal to 4)

Error:
	none


cos XE "COS" (x)

Returns the cosine of the angle x in the range between -1 and +1.

Argument:
	Any angle value, x, in degrees.

Example:
	y = cos(67.3)
	(y will be equal to 0.385906)

Error:
	none
cosh XE "COSH" (x)

Returns the hyperbolic cosine of the angle x which will be 
greater than or equal to one(1).

Arguments:
	Any angle value, x, in degrees.

Example:
	y = cosh(67.3)
	(y will be equal to 1.7729)

Error:
	none


dms XE "DMS" (d, m, s)

Given degree, minute, and second values, this function will 
return a single value in degrees, using the following formula: 
dms = d + (m/60) + (s/3600).

Arguments:
	Any d, m, or s value

Example:
	y = dms (23, 2, 55)
	(y will be equal to 23.0653)

Error:
	none


exp XE "EXP" (x)

Returns the natural exponential function, which is the value e 
raised to the xth power (ex).

Argument:
	x can be any value.

Example:
	y = exp(3)
	(y will be equal to 20.0855)

Error:
When the resultant value overflows, the value is set to 
the largest possible double precision value.


floor XE "FLOOR" (x)

Returns the value of x rounded down the nearest integer (the 
integer floor).

Arguments:
	x can be any value.
Example:
	y = 5.84
	x = floor(y)
	(x will be equal to 5)

Error:
	none


fmod  XE "FMOD " (x, y)

Returns the modulus, x mod y.  The modulus is the floating point 
remainder of an integer division.

Arguments:
	x and y can be any values.

Example:
	x = 55.32
	y = fmod (x, 3)
	(y will be equal to 1.32)

Error:
	none


hypot XE "HYPOT" (x, y)

Returns the length of the hypotenuse of a right triangle,  which is 
calculated using sqrt(x2 + y2)

Arguments:
	The lengths of the two legs of a right triangle, x and y.

Example:
	a = 3.5
	b = 6.7
	h = hypot(a, b)
	(h will be equal to 7.5591)

Error:
	none


log XE "LOG" (x)

Returns the natural logarithm of x.

Argument:
	Any number x which is greater than or equal to zero.

Example:
	y = log(4.9)
	(y will be equal to 1.58924)
Error:
	If x is less than zero, the error message 'log : DOMAIN 
error' is displayed.


log10 XE "LOG10" (x)

Returns the base 10 logarithm of x.

Argument:
	Any number x which is greater than or equal to zero.

Example:
	y = log10(3)
	(y will be equal to 0.477121)

Error:
	If x is less than zero, the error message 'log10 : DOMAIN 
error' is displayed.


pow  XE "POW " (a, b)

Returns the value of a raised to the power of b (ab).

Arguments:
	a and b can be any values.

Example:
	x = pow (3, 2.5)
	(x will be equal to 15.5885)

Error:
	none


sin XE "SIN" (x)

Returns the sine of the angle x in a range between -1 and +1.

Arguments:
	Any angle value x, in degrees.

Example:
	y = sin(16)
	(y will be equal to 0.275637)

Error:
	none


sinh XE "SINH" (x)

Returns the hyperbolic sine of the angle x which will be greater 
than or equal to zero (0).
Arguments:
	Any angle value x, in degrees.

Example:
	y = sinh(34)
	(y will be equal to 0.628857)

Error:
	none


sizeof XE "SIZEOF" (xxx)

Determines the size of an array (number of elements) or whether 
a variable has been defined.

Argument:
	xxx is the name of a variable or array.

Returns:
	An integer representing the size of the item specified, 
where:
		0 = undefined
		1 = defined single variable
		>1 = defined array of n elements

Example:
	n = sizeof (foobar)

Error:
	none


sqrt XE "SQRT" (x)

Returns the square root of x.

Argument:
	Any number x which is greater than or equal to zero.

Example:
	y = sqrt(18.67)
	(y will be equal to 4.32088)

Error:
If sqrt( ) is passed a negative value for x, then the error 
message 'sqrt : DOMAIN error' is displayed.


tan XE "TAN" (x)

Returns the tangent of x.

Arguments:
	Any value x, in degrees.

Example:
	y = tan(42)
	(y will be equal to 0.900404)

Error:
	none


tanh XE "TANH" (x)

Returns the hyperbolic tangent of x.

Arguments:
	Any value x, in degrees.

Example:
	y = tanh(42)
	(y will be equal to 0.624921)

Error:
	none

PROGRAM CONTROL STATEMENTS
Program control statements XE "program control statements"  decide the 
flow of the program execution by branching, looping or conditionally 
executing portions of code. The following is a brief discussion of each 
one of the program control statements.  For more detailed information, 
including formats and restrictions, refer to the Reference section.


The REM statement

The REM  XE "REM "  XE "program control statements:REM" statement 
can be used to insert comments into your code. This keyword, as well as 
any following text, is ignored by the system when the program is 
executed.  You therefore could also cause certain commands to be 
ignored just by placing REM in front of them.  

Example:

REM This is just a comment

REM PROMPT "This command will not be executed until the REM 
is removed"


The IF statement

The IF  XE "IF " statement is used to conditionally execu XE "program 
control statements:IF" te a portion of code.  The IF  has the format:

	IF (expr)
		statement

First, the expression (expr) is evaluated.  If it is true (nonzero), then the 
following statement is executed and program flow continues as normal.  
If the expression was evaluated as false (zero), then the statement 
following the IF statement is skipped and program flow continues with 
the next statement. 

Example:

	y = 5
	IF ( x > 10 )
		y = 0
	PAUSE "The value of y is %d",y


In this example, the expression (x > 10) is first evaluated.  If it true (x is 
greater than 10), then execution continues with the next statement 
which sets y equal to zero(0).  If it is not true (x is less than or equal to 
10), then the statement, y=0, is skipped and program flow continues 
with the following statement, in this case a PAUSE statement (see the 
Reference section for details on the PAUSE command).


Branching and Looping with Labels

A label XE " labels"  is used to mark a specific location within the 
program.  This location can th XE "program control 
statements:GOTO"  XE "program control statements:ON GOTO" en be 
referenced by a GOTO  XE "GOTO " or ON GOTO XE "ON GOTO"  
statement. When placing a label, you must precede the label with a 
colon.  For example:

	:menu1
Normally, CADL processes each statement from the beginning of a 
program to the end.  The GOTO statement allows execution to branch to 
a location in the program that has been labeled.  The format for a GOTO 
statement is:

	GOTO label

This causes the program to branch to the statement immediately 
following the specified label. When specifying the label in the GOTO 
statement, you don't need to include the semicolon.  

By using both the IF and GOTO statements you create program loops.

Example:

	i = 1
	
	:loop
		PAUSE "The value of i is %d",i
		i = i + 1 
		IF ( i <= 5 )
			GOTO loop
	
In this example, the PAUSE command will be executed five times.

The ON GOTO statement provides you with an easy way to branch to 
multiple labels based on a computed value.  The format for the ON 
GOTO statement is as follows:

	ON value GOTO [label1, label2, ...]

If value is computed to be a negative number or zero, execution will 
GOTO label1.  Computed values of 1, 2, 3, etc. causes execution to GOTO 
the second, third, fourth, etc. labels, respectively.  If there is a positive 
value for which there is no respective label, execution goes to the last 
label in the list.  This statement is really a replacement for a series of 
IF...GOTO statements.  The following two sections of code perform the 
same function:

	
IF (x <= 0) 
   GOTO lab1  
IF (x == 1)
   GOTO lab2
IF (x == 2)
   GOTO lab3 	
IF (x >= 3)
   GOTO lab4

ON x GOTO lab1, lab2, lab3, lab4


Program Branching

The GOTO and ON GOTO statements are for branching within the 
current CADL program. CHAIN  XE "CHAIN " and DOSUB  XE "DOSUB 
" are for branching off the normal program flow into other CADL XE 
"program control statements:CHAIN"  XE "program control 
statements:DOSUB"  files. 

DOSUB transfers control over to a specified CADL file. When the end of 
that file is reached or an EXIT statement (see below) is processed, control 
then returns back to the original file at the statement immediately 
following the DOSUB statement.

CHAIN transfers control to a specified CADL file, but there is no return 
to the original file as in the DOSUB statement.  

Exiting a CADL program

Normally a CADL program is done when it reaches the end of the file.  
However, if you want to terminate the program before it reaches the end 
of the file, there are two statements to do it: ABORT  XE "ABORT " and 
EXIT XE "EXIT" .  Although they both will immediately exit the current 
program, there is a dif XE "program control statements:EXIT"  XE 
"program control statements:ABORT" ference in what they will do 
afterwards.

ABORT will always terminate the current program and return you to the 
CADKEY or CUTTING EDGE program. 

EXIT will also terminate the current program, but if that program was 
executed by a DOSUB statement, EXIT will return control over to the 
program with the DOSUB statement in it.  If the current program was 
not called by a DOSUB statement, then it will return you to the CADKEY 
or CUTTING EDGE program.


Suspending CADL Execution

The WAIT  XE "WAIT " command will suspend CADL execution for XE 
"program control statements:WAIT"  a specified number of seconds. 


Calling External Programs or System Processes

To call an external program or access a system process, you must use the 
EXEC  XE "EXEC " command.  When executed, this command 
temporarily suspends the system and executes the command that you 
specified.  When  XE "program control statements:EXEC" the program or 
process is complete, control is returned to the statement immediately 
following the EXEC statement.


Declaring the Security Code String

The CODE  XE "CODE " command declares the proper security code 
string to allow file execution to occur.  If the CODE string does not 
match the security code string in SECURE.DAT XE "SECURE.DAT" , 
then the  XE "program control statements:CODE" program will not run.  
This command is not required unless the default SECURE.DAT file 
supplied with your CADKEY or CUTTING EDGE installation diskettes 
has been changed.

Compiler-Specific Control Statements

The following is a list of program control statements that can only be 
used in compiled programs (see the Compiler section for details):

CONTINUE
DO ... WHILE
EXITLOOP
FOR
IF
LOCAL
SWITCH
WHILE


_____________________________________________________________________________

Section Two: Commands

Table Of Contents

Introduction
Entity Primitives
Entity Control
Drawing Entities
Deleting Entities
Aligning Ordinate Dimensions
Entity Selection
Entity Attributes
Display Control
Redrawing Viewports
Scaling
Clearing a Viewport
Selecting Displayed Levels
Level Descriptors
Viewport Control
Normalized Device Coordinate System
Viewport Manipulation
Viewport Information Inquiries
View Manipulation
Defining a New View
Converting CADL Reference Numbers to CADKEY View Numbers
View Descriptors
Setting the Display View and the Construction View
Retrieving a System View Matrix
Coordinate System Transfer
User Interaction
The Prompt Line
Menus
Data Input
Getting a 3D Coordinate
Selecting Attributes
Selecting a Plane
Selecting Entities
Checking the Keyboard Buffer
Data File Input and Output
Input Commands
Output Commands
Closing a File
Part and Pattern File Access
Saving and Loading Part Files
Part File Descriptors
Saving and Loading Pattern Files
Setting System Values
Color Graphics Palette
Graphics Cursor Location
Note Text Attributes
Levels Displayed
System Parameters
Strings and Arrays
Copying an Array
String Functions
Vector Math Functions
Copious Entities
Copious Types
Copious Entities
Copious Data
Collectives
Creating A Collective
Adding Entities To A Collective
Removing Entities From A Collective
Controlling Collective Selection
Groups
Creating a Group
Getting Group Information
Dialog Box Manager
Basics
Dialog Box Coordinate Systems
Dialog Box Design Considerations
Creating a Dialog Box
Child Dialog Boxes
Drawing a Dialog Box
Erasing A Dialog Box
Destroying A Dialog Box
Dialog Box Entities
Entity Index
Entity Position
Entity Attributes
Buttons
Boxes
Input Fields
Notes
Radio Buttons
Sliders
List Boxes
Check Boxes
Combo Boxes
Tables
Icons
Titles
Deleting Entities
Errors In Creation And Modification
Freezing A Dialog Box
Running the Dialog Box
Keyboard Bindings
Selecting the Focus
Accessing CDE Modules

Introduction
The purpose of a command is to perform operations much like functions 
found in the main CADKEY or CUTTING EDGE program. A command 
consists of a keyword followed by one or more parameters. For example:

SET COLOR,3

defines the current color as if you had used the Immediate Mode 
Command or the COLOR function. Variable assignments may also be 
used in describing commands as explained under Register Variables.

Note that a space is only recognized in a command when it is used to 
separate the keyword from its parameters.
Entity Primitives
A data primitive specifies the information for an entity in the  database. 
When executed by the  CADL processor, these primitives are converted 
to  entities and vice versa.

An example of a data primitive found in a CADL file is:

	LINE 1.5, 3.0, 0.0, 3.5, 2.0, 0.0, 1, 1, 1, 1, 2, 1

Each value represents an assigned parameter (refer to LINE primitive). 
Those parameters not specified are defaulted to the values assigned for 
each specific argument. Variable assignments may also be used in 
describing primitives as explained in Register Variables.

If you wish to use a default parameter for an option, you may use either 
or both of the following options:

If a parameter to be omitted falls between other parameters, omit the 
specific parameter in the description, but not the commas.

If a parameter falls at the end of a primitive description line, use less 
than the total number of parameters permitted for a given command.

For example, in the POINT primitive:

	POINT 8.5, 3.0, 22., , 7

the color parameter which is supposed to occur between the 22. and 7 
parameters, and the group number, subgroup number, and pen number 
which normally occur after the 7 parameter, are automatically set to 
default values because they are not specified.


Recognition of Entity Primitives
MODE  XE "MODE " allows the operational mode for CADL file 
execution to be set, with regard to the recognition of data primitives.  
Three modes are available:
	
	NORMAL - displays primitives on the screen and adds them to 
the database
	DRAW - only displays them on the screen (does not add them to 
the database)
	SUPPRESS - only adds them to the database (does not display 
them)

The following list specifies all the displayable primitives supported in 
CADL:


ANGDIM (Angular Dimension)
ARC
CIRCLE
CIRDIM (Circular Dimension)
CONIC
FNOTE, NFNOTE (File Note)
GENDIM (Generic Dimension)
LABEL, NLABEL
LEADER, 
NLEADER
LINDIM (Linear Dimension)
LINE, VLINE
NOTE, NNOTE 
ORDDIM (Ordinate Dimension)
POINT, VPOINT
POLYGON, 
VPOLYGON
POLYLINE
SPLINE
WITNESS, 
NWITNESS
XHATCH

Some primitives now have two versions, one preceded 
by an 'N' (the new style), and one without (the old 
style).  Both versions will create the same entity but 
the new versions make use of the system arrays for 
input of parameters. The old version may not be 
supported in future versions of CADL.

Entity Control
Drawing Entities

To draw a particular entity,  XE "entity control:drawing" use the 
DRAWENT  XE "DRAWENT " command.  In order to draw the entity, it 
must be at least partially within the current viewport bounds, be in the 
current view and be on a displayed level.  To draw all entities at once, 
use the REDRAW  XE "REDRAW " command.  


Deleting Entities

To delete entities, use the DELENT  XE "DELENT " co XE "entity 
control:deleting" mmand.  With this command you can delete the last 
entity found by one of the get entity commands (i.e., GETENT, 
GETNEXT, etc.), delete a specific entity by its ID number, or else delete 
all entities currently in the selection list.


Aligning Ordinate Dimensions

ORDALIGN  XE "ORDALIGN " allows you to align the specified 
ordinate dimension entity.  An ordinate dimension is a collective en XE 
"entity control:ordinate alignment" tity and therefore, the ID of only one 
of its many ordinates need be passed.  The system will automatically 
align the dimension. 


Entity Selection

To select an entity by its ID number, use GETENTID XE "GETENTID" .  
To select an entity at a particular X, Y view location, use GETENTXY XE 
"GETENTXY" .  

To select all entities within the current window boundaries, use the 
GETALL  XE "GETALL " command.  If the selection process is successful, 
a selection list will be created, containing all the entities selected.  To 
process through the list, you must use the GETNEXT  XE "GETNEXT" 
command.  GETNEXT will retrieve the data for each entity selected one 
at a time from the selection list.  If you need to clear the selection list, 
use CLEARSEL XE "CLEARSEL" .  


Entity Attributes

DEFATTR XE "DEFATTR" , in conjunction with SETATTR XE 
"SETATTR" , allows for a number of entity attributes to be changed 
through CADL file execution XE "entity control:attributes" .  The 
purpose of DEFATTR is to define which attributes are to be set, as well as 
the order in which they are to appear.  Once defined, SETATTR is called 
to actually modify an entity's attributes.  The attributes you can set are:

color
fill color
group number
level number
line type
line width
pen number
subgroup number
text rotation angle
text aspect ratio
text fill mode 
text font 
text height
text line spacing factor
text mirror mode
text slant angle
text underline mode


Display Control
Redrawing Viewports

When you change the scale of a particular viewport, or change which 
levels are to be displayed, the effects aren't immediately noticeable.  
Although the changes were made  XE "viewports:redraw 
entities" internally, the viewport(s) aren't automatically updated.  To 
update them, you need to use the REDRAW  XE "REDRAW " command.  
REDRAW allows you to redraw a specific viewport or all of them at 
once. 


Scaling

The AUTO  XE "AUTO " command will scale the current part to fit 
totally inside the selected viewport(s).  To zoom-out, by dividin XE 
"scaling:automatic" g t XE "scaling:double"  XE "scaling:half"  XE 
"scaling:scale to window"  XE "scaling:setting specific scale" he current 
part scale factor by two, use the HALF  XE "HALF " command.  XE 
"viewports:automatic part scaling"  XE "viewports:double scale"  XE 
"viewports:half scale"  XE "viewports:set part scale"  XE 
"viewports:zoom in on a window"  XE "viewports:zoom-in"  XE 
"viewports:zoom-out"  To double the current scale value of a viewport, 
or effectively zoom-in, use DBLSCL XE "DBLSCL" .  To zoom-in on a 
specific area within the viewport, you can use the WINDOW  XE 
"WINDOW " command.  You can also set the exact scale factor by using 
the SCALE  XE "SCALE " command. 

All these scaling commands allow you to scale either the primary 
viewport, a specified viewport, or all the viewports. 

Clearing a Viewport

The CLS  XE "CLS " command will clear a specified view XE 
"viewports:clear" port, the primary viewport, or all of them.  This clears 
only the graphics that are displayed; it doesn't affect the entity data in 
any way.


Selecting Displayed Levels

The LEVELS  XE "LEVELS " command allows you to turn a level on or 
off.  When a level is on, it will be display in the viewport(s).  When a 
level is off, any entities that are on that level will not be displayed.  You 
can select a specific level to turn on or off, or you select a range of levels.


Level Descriptors

To set or retrieve the descriptor of an existing level, use the 
sys_put_name xe "sys_put_name"  and sys_get_name xe 
"sys_get_name"  commands, respectively.
Viewport Control
Normalized Device Coordinate System

The Normalized Device Coordinate System XE "Normalized Device 
Coordinates"   XE "NDC" (NDC) is the system used to place and locate 
viewports in graphics area.  The graphics area in this system is 
considered to be one unit in both the vertical and horizontal direction.  
This means that any horizontal or vertical coordinate will be between 
zero (0.0) and one (1.0).

 

Viewport Manipulation

To add a viewport to the graphics area, use the sys_addvp xe 
"sys_addvp"  command.  The new viewport to be added cannot overlap 
any other  XE "viewports:adding" existing viewports or else an error will 
be returned and the viewport will not be created.  The total number of 
viewports cannot exceed the limit set in the configuration program.

The delete a viewport, use the sys_delvp xe "sys_delvp"  XE 
"viewports:removing"  command.  It is possible to delete all of the 
viewports from the graphics area, which could be useful when you are 
trying to create a custom configuration of viewports.  

To set the graphics area to one of eight standard viewport 
configurations, use sys_autovp XE "sys_autovp" .  When selecting which 
of the configurations you wish to set to, you can a XE "viewports:default 
configurations" lso pick which viewport will be considered the primary 
viewport.  

To resize or move a viewport, use sys_movevp XE "sys_movevp" .  This 
command all XE "viewports:resizing" ows you to XE 
"viewports:moving"  select which viewport is to be changed, and the 
new positions for each corner of the viewport.  


Viewport Information Inquiries

To determine what th XE "viewports:retrieving information" e NDC size 
of a text box of rows and columns, use the sys_inqtbsize xe 
"sys_inqtbsize"  command.  This can be useful when resizing viewports 
so that they do not overlap a dialog box.

To find out the definition coordinates of a particular viewport,  XE 
"viewports:definition coordinates" based on the  graphics area, use the 
sys_inqvpdef xe "sys_inqvpdef"  command.  To find out the definition 
coordinates based on the entire screen, use CALL INQ_VP_NDC. XE 
"INQ_VP_NDC"  XE "CALL:INQ_VP_NDC" 

The sys_inqvpinfo xe "sys_inqvpinfo"  command will provide you with 
the following information: 

	1. The current viewport mask
	2. The primary viewport number
	3. The number of available viewports
View Manipulation
Defining a New View

To define a new view, you must use the VIEW  XE "VIEW " primitive 
(even if you want to use one of the predefined  views).  You supply the 
primitive with the nine numbers that make up the view matrix and it 
returns a CADL reference number for that view.  


Converting CADL Reference Numbers to CADKEY View Numbers

The CALL CDLV2SYSV XE "CDLV2SYSV"  XE "CALL:CDLV2SYSV"  
command will convert a CADL reference number to a System view 
number.  


View Descriptors

To set or retrieve the descriptor of an existing view , use the 
sys_put_name xe "sys_put_name"  and sys_get_name xe 
"sys_get_name"  commands, respectively.


Setting the Display View and the Construction View

To set the display view to a specific System view number, use the SET 
VIEW XE "VIEW, SET"  XE "SET:VIEW"  command.  If you wish to set the 
construction view, use SET CVIEW XE "CVIEW, SET"  XE "SET:CVIEW" .  
Both SET VIEW and SET CVIEW take the System view number as a 
parameter, not the CADL reference number.  


Retrieving a System View Matrix

The GETVIEW  XE "GETVIEW " command will retrieve a specified 
system view and store its view matrix elements in the system array, 
@FLTDAT in elements 0 through 8.


Coordinate System Transfer

There are four CALL commands that allow you to translate the position 
of a point as you change views.

To transfer a point from world to view coordinates, there are two 
commands you can use.  CALL XFWV XE "CALL:XFWV"  XE "XFWV"  
transforms a world coordinate to a view coordinate using the current 
view matrix.  CALL XFMWV XE "CALL:XFMWV"   XE "XFMWV 
" transforms a world coordinate to a view coordinate using a specified 
view matrix.

To transfer a point from view to world coordinates, there are two 
commands you can use.  CALL XFVW XE "CALL:XFVW"   XE "XFVW 
" transforms a view coordinate to world coordinates using the current 
view matrix.  CALL XFMVW XE "CALL:XFMVW"   XE "XFMVW 
" transforms a view coordinate to world coordinates using the specified 
view matrix.

If you wish to translate a point from one view to another, you must use 
the world coordinate as an intermediate step.  For example, if you 
wanted to translate a point from view 2 to view 4, you would have to 
translate from view 2 to world coordinates, then from world to view 4 
coordinates.
User Interaction
The Prompt Line

Most of the commands in this section include a parameter that allows 
you to modify the prompt line.  However, you can also output a string to 
the prompt line at any other time.  The two commands, PROMPT  XE 
"PROMPT " and PAUSE XE "PAUSE" , will output a specified string to 
the prompt line.  The only difference between the two is that PAUSE will 
output the string and then wait for the user to hit <Enter> before giving 
control back to the program.  PROMPT prints out the string and then 
immediately returns control to the program. 


Menus

The GETMENU  XE "GETMENU " command allows you to specify a 
string to be displayed on the prompt line, up to nine menu options, 
which menu item, if any, will be considered the default option, and 
whether or not to modify the history line when the user makes a 
selection.

CLEARHST  XE "CLEARHST " will clear the history line from a certain 
position to the end of the line.  If no position is specified, the entire 
history line will be cleared.  

Data Input 

 GETFLT XE "GETFLT" , GETINT XE "GETINT" , and GETSTR  XE 
"GETSTR " allow the user to input a float, an integer, or a string, 
respectively.  Each of these input commands allow you to set the string 
that will be output on the prompt line, set a default value and specify up 
to nine menu choices.  Control is returned to the program when the user 
either types in a value, selects a menu choice, or else hits ESCAPE or 
BACKUP. 


Getting a 3D Coordinate

GETPOS  XE "GETPOS " displays a text string on the first half of the 
prompt line along with the  position menu, and then waits until a 3D 
position is indicated using one of the options provided by the position 
menu.

GETCUR  XE "GETCUR " allows you a little more control than GETPOS.  
With GETCUR, you can specify a cursor style from the following list:

arrow
crosshairs
drag box
rubberband box
rubberband line

 You can also display a menu in the  menu area.  Control returns to your 
program when the user either selects a menu item or a 3D position.  


Selecting Attributes

GETCOLOR  XE "GETCOLOR " displays a text string on the prompt line 
and a window of color icons.  You specify whether the number of 
selectable colors is 16 or 256.  It then waits for the user to select one or 
more colors. 

To allow the user to select a line type from a window of line type icons, 
you need to use GETLTYPE XE "GETLTYPE" .  To let the user select a line 
width, use the GETLWIDTH  XE "GETLWIDTH " command.


Selecting a Plane

GETPLANE  XE "GETPLANE " allows the user to choose a method for 
plane selection using plane selection menu.  After the user has selected a 
method and then selected the plane, control is returned to the program.


Selecting Entities

GETENT  XE "GETENT " displays a text string on the prompt line, 
activates the graphics cursor, and waits until a single entity is selected.  
To allow the user to select more than one entity, you can use the 
GETENTM  XE "GETENTM " command.  GETENTM invokes the  general 
selection mechanism and waits until one or more entities are selected.  If 
the selection process was successful, you will need to use GETNEXT  XE 
"GETNEXT " to retrieve the data on each entity in the list.  If you need to 
clear this selected list of entities, use the CLEARSEL  XE "CLEARSEL 
" command.  


Checking the Keyboard Buffer

Use GETKEY  XE "GETKEY " to check the system keyboard buffer.  If 
there is a character in the buffer, this command will also return its 
character code, including the ESCAPE, BACKUP and CR (<Enter>) keys.
Data File Input and Output
Input Commands

READ  XE "READ " causes data to be read from an ASCII file and set into 
specified variables.  The data file consists of numeric values separated by 
commas.  For each variable specified, a number is extracted from the 
data file.

INPUT  XE "INPUT " reads characters, integers, and floating point 
numbers from the current standard input device in a variety of ways 
through the use of a format string.  INPUT is a more flexible alternative 
to the READ command.  The format string can contain any number of 
field specifiers which are used to describe how input data should be read 
and converted to variable values.  For each specifier, a variable name is 
parsed from the statement and set accordingly.

READDEV  XE "READDEV " reads the CADL digitizing device for a 
coordinate position, optionally waiting for a function button to be 
pressed.  The number of dimensions returned and the nature of any 
additional information returned is device dependent.  


Output Commands

WRITE  XE "WRITE " provides a means of writing out variable values to 
a data file.  To open a file, you can select from the four following modes: 
overwrite file if it already exists, append to the end of a file, create only 
a new file (no overwrite), and append only to an existing file.

PRINT  XE "PRINT " allows the user to write characters, integers, and 
floating point numbers to the current standard output device in a 
variety of ways through the use of a format string.  PRINT is a more 
flexible alternative to WRITE.  The format string can contain any 
number of field specifiers, which are used to describe how values should 
be converted and written to the output device.


Closing a File

The CLOSE  XE "CLOSE " command will close either the standard input 
device (DEVIN), the standard output device (DEVOUT), or a data file.  
Data files are normally closed only at CADL termination or whenever 
the EXEC command is processed.  This command can be used to close a 
data file any other time.  DEVOUT should be closed if DEVIN is to be 
used to read what was written to DEVOUT.
Part and Pattern File Access
Saving and Loading Part Files

To load and save part files, use sys_prt_load xe "sys_prt_load"  and 
sys_prt_save XE "sys_prt_save" , respectively.  When saving a part, you 
have the option of locking the file and choosing if you will want to 
overwrite a file if it has the same name as the part you're currently 
saving.

Part File Descriptors

To find out what the descriptor for the currently loaded part is, use the 
sys_prt_desc_inq xe "sys_prt_desc_inq"  command.  

To set the part descriptor of the currently loaded part, use 
sys_prt_desc_set xe "sys_prt_desc_set" .  

Saving and Loading Pattern Files

The sys_ptn_load xe "sys_ptn_load"  and sys_ptn_save xe 
"sys_ptn_save"  commands load and save pattern files, respectively.  
When loading a pattern, you have access to all the options that you 
would have if you were loading a pattern directly from CADKEY or 
CUTTING EDGE.  These options include grouping the pattern, placing 
the pattern on a particular level, and setting the scale, rotation and view 
of the pattern.  When saving a pattern, you must specify the entities to 
save in the pattern, either by their individual ID numbers, or using the 
selection list (see GETENTM or GETALL).  You can also choose to 
overwrite an existing pattern file of the same name if it exists.  
Setting System Values
Color Graphics Palette

To set one or more colors in the CADKEY color graphics palette, use the 
PALETTE  XE "PALETTE " command.  Each color defined is a 
combination of red, green, and blue intensities.

PRANGE  XE "PRANGE " allows a range of colors in the System graphics 
palette to be set such that a linear blend is chosen between the start and 
end RGB (red, green, and blue) values specified.


Graphics Cursor Location

SETCUR  XE "SETCUR " sets the display of the current graphics cursor 
position to the specified view coordinate position.


Note Text Attributes

SETNOTE  XE "SETNOTE " performs the same function as using the 
DETAIL,  SET function of the system.  It allows you to set various note 
text parameters which will be assigned to all subsequently created notes.  
The attributes you can set are:

aspect ratio	filled font	font	line spacing 
factor
rotation angle	slant angle	text height	underlining


Levels Displayed

LEVELS  XE "LEVELS " changes the levels displayed by adding or 
removing either a single level or a range of levels.

System Parameters

System parameters can be set through CADL file execution through use 
of the SET  XE "SET " command.  The parameters that can be set by this 
command are as follows:

Directory Paths

CADL directory 
note files directory
part files directory
pattern files directory
plot files directory



System Masks

color mask
entity mask
level mask
level mask
line type mask
line width mask
pen mask
selection mask



Dimension 
Parameters

arrowhead direction
arrowhead style
dimension text fill 
mode
dimension text font
dimension text height
dimension text slant 
angle
leader style
line type
line width
note fill mode
note font
note rotation angle
General System 
Parameters

construction 
depth
construction 
mode
construction 
plane
coordinate entry 
mode
cursor snap 
alignment and 
increment
cursor snap mode
cursor tracking
database search 
and draw order
decimal precision
display of 
construction view 
axes
display view axes
grid alignment 
and increment
grid mode
immediate mode 
command switch
line limit mode
standard input 
device
standard output 
device
system color
system level
system pen 
number
system unit mode
verify selection 
mode
view number for 
specific viewport


Strings and Arrays
Copying an Array

CALL MEMCPY XE "CALL:MEMCPY"   XE "MEMCPY " will copy one or 
more elements from a one dimensional array, at a specified source index, 
to a one dimensional destination array (starting at a specified 
destination index).


String Functions

To concatenate two strings, you need to use the CALL function, CALL 
STRCAT XE "CALL:STRCAT"  XE "STRCAT " .  This function takes in 
two strings, s1 and s2, and concatenates s2 onto the end of s1.  For 
example:

$s1 = "Hello"
$s2 = " world."
CALL STRCAT $s1, $s2

After this is executed, $s1 will contain the following string:

"Hello world." (including a null terminator)

To compare two strings, there are two CALL functions you can use.  To 
make a case-sensitive comparison of two strings, use CALL STRCMP XE 
"CALL:STRCMP"  XE "STRCMP" .  To compare two strings without 
regard to letter case,  use CALL STRCMPI XE "CALL:STRCMPI"  XE 
"STRCMPI" .  Both functions will tell you if the strings match or else 
which string is of greater value at the first non matching character.

To copy one string to another, you need to use the CALL STRCPY XE 
"CALL:STRCPY"   XE "STRCPY " function.  (If you only wish to copy a 
particular section of a string, use the CALL MEMCPY XE 
"CALL:MEMCPY"   XE "MEMCPY " function).

The CALL STRLEN  XE "CALL:STRLEN "  XE "STRLEN " function will 
return the length of a string, not including the null terminator.

To convert a string to a floating point value, you need to CALL 
STRFLT XE "CALL:STRFLT"  XE "STRFLT" .  To convert a string to an 
integer value, use the CALL STRINT XE "CALL:STRINT"   XE "STRINT 
" function.

SPRINT  XE "SPRINT " allows you to write characters, integers, and 
floating point numbers into a string variable through the use of a format 
string.
Vector Math Functions
The calculate the cross product of two vectors, use CALL CROSS XE " 
CALL:CROSS"  XE "CROSS" .

The dot product of two vectors is calculated using the CALL 
DOTPROD XE "CALL:DOTPROD"   XE "DOTPROD " function.

To determine an arc tangent that works in all four quadrants and 
outputs a value in the range of 0.0 to 2*pi, use CALL ATAN3 XE 
"CALL:ATAN3"  XE "ATAN3" .
Copious Entities
Copious entities are non-displayable data entities that are accessible 
only through CADL.  These entities are stored in the part file when the 
part file is saved, so that they are available when the part file is loaded 
again.  There are three groups of commands that manipulate, 
respectively:

	1. The different types or classes of copious entities.
	2. The copious entities under each type.
	3.The data stored in each copious entity.


Copious Types

A copious type identifies a group of copious entities by name and type 
number.  Every copious entity created must belong to an existing copious 
type.  

The command for defining a copious type is ADDCTYPE XE 
"ADDCTYPE"  XE "copious commands:adding entity types" .  There can 
be a maximum of 256 copious types in a part file at one time.  

To delete a copious type, use the DELCTYPE  XE "DELCTYPE 
" command.  You can only  XE "copious commands:delete entity 
type" delete a copious type when no copious entities exist of that type.  

If you know the name of the copious type and you need to know its type 
number, use INQTCODE XE "INQTCODE" .  If you know the type 
number and nee XE "copious commands:retrieve type name" d the name, 
 XE "copious commands:retrieve type code" use INQCTYPE XE 
"INQCTYPE" .


Copious Entities

A copious entity can be created in a part file by defining its size and 
indicating the copious type to which it will belong.  

To add a copious entity, use ADDCOP XE "ADDCOP" .  The size of the 
copious entity will dep XE "copious commands:adding a copious 
entity" end on the data that will be stored in the copious entity.  The 
following types of data can be stored in a copious entity:

characters
integers
unsigned shorts
long integers
double precision floats
copious entity type codes
entity or copious ID's
copious entity sizes

Since these data types can have different sizes on different systems, use 
the COPSIZE XE "COPSIZE" () function to determine the size of a data 
type.

The command to select a copious entity that already exists in the part 
file is GETCOP XE "GETCOP" . XE "copious commands:selecting a 
copious entity"   

DELCOP  XE "DELCOP " will del XE "copious commands:delete a 
copious entity" ete a copious entity that is no longer needed in a part file.  


Copious Data

After a copious entity has been creat XE "copious commands:data 
output" ed, data can be stored in it.  The command to write information 
to a copious entity is CWRITE XE "CWRITE" .  A copious entity must be 
selected with the GETCOP command before data can be stored in it.  

To read data from an existing copious entity, use  XE "copious 
commands:data input" the CREAD  XE "CREAD " command.  As with 
CWRITE, a copious entity must be selected before its data can be read. 

Every time a copious entity is selected for reading or writing, a pointer is 
set to the beginning of its data.  The pointer is moved forward with every 
CREA XE "copious commands:move data pointer" D and CWRITE 
command according to the data being read or written.  However, the 
pointer can be moved separately using the CMOVE  XE "CMOVE 
" command, either relative to the current pointer position or to an 
absolute location within the data.
Collectives
Creating A Collective

To  XE "collectives:creation" create a collective before any of the entities 
have been created, use the "SET collect, mode" command.  When you set 
the mode to 1 (on), any entities created afterwards will be put into a 
collective.  When all the entities have been created that you wish to be in 
the collective, set the mode to 0 (off).  This causes all following created 
entities to be created normally.  

To create a collective after the entities have already been created, use the 
command, MAKECOLL XE "MAKECOLL" .  There are two ways to 
specify which entities are to be in the collective.  The first way is to 
specify a list of entity ID's in an array.  The second way is to specify a 
range of entity ID's by supplying MAKECOLL two ID's, the minimum 
and maximum.  


Adding Entities To A Collective

To add an  XE "collectives:adding an entity" entity to a collective or to 
combine two collectives, use the ADDCOLL  XE "ADDCOLL " command.  
This command takes as parameters two entity ID's.  If you wish to add 
an entity to a collective, one ID must be of an entity already inside the 
collective, and the other will be the entity you wish to add.  If you want 
to combine two collectives, pick an entity ID from both collectives and 
the two collectives will be joined.  


Removing Entities From A Collective

To remove a single e XE "collectives:remove an entity" ntity from a 
collective, use the REMCOLL  XE "REMCOLL " command.  

If you wish to remove all entities from a specific collective XE 
"collectives:removing all entities" , use BURSTCOLL XE "BURSTCOLL" .  
All you need to specify is one ID from an entity within the collective.


Controlling Collective Selection

"SET collsel, mode" controls the manner in which collective entities are 
put into the selection list when selected using GETENT XE "GETENT" , 
GETENTM XE "GETENTM" , GETENTXY  XE "GETENTXY " and 
GETALL XE "GETALL" .  If mode is set to 0, all the entities in the 
collective are highlighted and the first entity is put into the selection list.  
The rest of the entities in the collective cannot be selected through  XE 
"collectives:entity selection" user interaction but only with the 
NEXTCOLL  XE "NEXTCOLL " command.  If mode is set to 1, only the 
selected entity is highlighted and put into the selection list.
Groups
Creating a Group

The GROUP  XE "GROUP " primitive sets up a group with a specified 
number of subgroups.  The GROUP primitive also requires that you 
include a group name, a string up to eight characters in length, and the 
group reference number.  This number is used in other primitive calls to 
place an entity in a specified group upon creation.

Getting Group Information

GETGROUP  XE "GETGROUP " will return  the group name and 
subgroup flags for a specified group reference number.  
Dialog Box Manager
Basics

A dialog box is a collection of entities that are set up by the application 
and then manipulated by the user.  Currently, the dialog box manager 
supports 11 entity types.  They are: buttons, radio buttons, check boxes, 
list boxes, notes, boxes, input fields, tables, combo boxes, sliders, and 
icons.

This chapter describes the dialog box commands. These commands 
provide dialog box management for the user interface.

For each entity type, there are routines to create an entity, change an 
entity's attributes, and to gather information from an entity.  There are 
also routines for creating a dialog box, running a dialog box, and 
destroying a dialog box.

Dialog Box Coordinate Systems

 XE "dialog boxes:coordinate system" Because dialog boxes are 
implemented as a special case of a  text window, the Y-axis runs from 
top to bottom.  Also, all numbers are in "font units."  Therefore, an icon 
defined to reside at 0,0 at the top left of the dialog box.  If it is 2 units 
high by 2 units wide, it is as big as a 2 by 2 stack of letters.  This scheme 
allows all dialog entities to scale correctly regardless of resolution or text 
fonts available on the target machine.  Also, note that the coordinates for 
anchor points are doubles.  

Dialog Box Design Considerations

 XE "dialog boxes:maximum size" Do not define a dialog box bigger than 
can be shown on an EGA screen.  This is approximately 20 lines high by 
60 characters wide.  


Creating a Dialog Box

 XE "dialog boxes: creating" The dialog box is identified by an ID.  This ID 
is preserved for the life of a dialog box.  An application uses this ID as 
the "dialog box handle."  This handle is used for most of the provided 
routines. 

The dg_init_dialog xe "dg_init_dialog"  command creates a dialog box. 
and returns a value in the system variable @ERROR. The value in 
@ERROR is either a dialog box handle, or 0 if it could not satisfy the 
request.

Child Dialog Boxes

You can define a dialog box XE "dialog boxes: child dialog boxes"  to be a 
child of another dialog box.  A child dialog box displays only if its parent 
is currently displayed.  The child dialog box must be completely inside 
the parent. The dialog box manager tries to enforce this rule, but it is 
possible to confuse it in pathological cases.

The child dialog box also has a dialog box handle. While working inside 
a child dialog box, its handle should be used.

After initializing a child dialog box, you can use all the dialog box 
manager calls on it.  Just be sure that when you call dg_draw_dialog xe 
"dg_draw_dialog"  for the child, that the parent is still displayed, and 
remember to call dg_erase_dialog xe "dg_erase_dialog" , so that the 
parent redraws correctly.  

When you call dg_run_dialog xe "dg_run_dialog"  for the child, only the 
entities in the child dialog box are active, even if you still see entities in 
the parent dialog box.

Drawing a Dialog Box

 XE "dialog boxes: drawing" Once you define the dialog box using 
dg_init_dialog xe "dg_init_dialog"  or dg_child_dialog xe 
"dg_child_dialog" , and also define the entities using the entity routines 
presented, you will want to paint it on the screen using 
dg_draw_dialog. XE "dg_draw_dialog" 

Erasing A Dialog Box

 XE "dialog boxes: erasing" After you finish user interaction, you can 
remove the dialog box and restore the viewports behind it.  This does not 
alter the dialog box's internal structures, but merely removes it from the 
screen.

To erase a dialog box use the dg_erase_dialog xe "dg_erase_dialog"  
command. Make sure to pass the appropriate handle for the system. In 
order to erase a parent dialog box, all its children should be erased.

Destroying A Dialog Box

The dg_free_dialog command frees all associated memory, and destroys 
the dialog box. You can use this after you complete user interaction. XE 
"dialog boxes: destroying"  XE "dg_free_dialog" 

Dialog Box Entities

Entity Index
 XE "dialog box entities:index" Each entity has a unique index number 
associated with it.  When you create a dialog box, you must specify items 
to be the maximum number of entities you plan to create.  As you are 
creating entities, you can then specify any index as long as it's in the 
range between 0 and (items-1). The index can then be used to:


o	Notify you that an entity has changed.
o	Tell the dialog box manager which entities' attributes to change.
o	Request information about an entity.
o	Modify or delete an entity.

Entity Position
 XE "dialog box entities:position" Each entity has an anchor point, 
specified in text coordinates.

You manipulate attributes with dg_get_flags xe "dg_get_flags"  and 
dg_set_flags XE "dg_set_flags" .  These commands return and set the 
attributes for the specified entity, respectively.

You can also specify attributes bits when you create an entity.


Buttons
 XE "dialog box entities: buttons" The dg_add_button xe 
"dg_add_button"  command creates a button.

The button has a space before and after the text, which is centered in the 
button.  Specify the value of nc, so that dialog boxes that translate into 
foreign languages still line up correctly.

A button has a flag value DG_RET_ON_SEL(0x0001) specified by 
default.  Buttons take up an extra cell in each direction around them, for 
the effect. 

Extracting Button Information
There is no information to extract.  The dialog box manager tells you that 
a button has been pressed.
Boxes
 XE "dialog box entities:boxes" A box is an entity that shows group 
associations.  You create a box with the dg_add_box xe "dg_add_box"  
command. There is no information to extract from a box.


Input Fields
 XE "dialog box entities:input fields" There are three types of input fields: 
STRINGS, DOUBLES, and INTS. The calculator processes all input for 
double fields, so the user can type "3 + 4.57 + @depth" into a double field, 
and the computed value is placed in the field.

To input a value use the dg_add_text_double xe "dg_add_text_double" , 
dg_add_text_int  xe "dg_add_text_int " and dg_add_text_string XE 
"dg_add_text_string"  commands.

Extracting Input Field Information
The dg_get_text_double xe "dg_get_text_double" , 
dg_get_text_string XE "dg_get_text_string" , and dg_get_text_int XE 
"dg_get_text_int"  commands return the current value of an input field.

Modifying Input Fields
You can modify the contents of an input field.  The 
dg_set_text_double xe "dg_set_text_double" , dg_set_text_string XE 
"dg_set_text_string" , and dg_set_text_int xe "dg_set_text_int"  
commands give a new value to the field.  To change the type of the field, 
delete it and recreate it.

Notes
A note is a string of text in the dialog box.  If you set the flag value to 
DG_RET_ON_SEL (0x0001) for a note, it acts like a button, but without 
the highlighting effect.  Use this for emulating a hypertext XE 
"hypertext, emulating"  or Rich Text Format (RTF) XE "Rich Text Format 
(RTF), emulating"  application.


Radio Buttons
 XE "dialog box entities:radio buttons" Radio buttons allow the user to 
choose one option from a multiple option selection.  The application 
specifies the strings for each choice, and which one is currently chosen.  
The user changes the selection by clicking on either the box or the 
associated text.  If the text value passed to dg_add_radio is omitted, you 
can add the entries, one at a time, using dg_set_radio_text XE 
"dg_set_radio_text" . xe "dg_add_radio" 

Extracting Radio Button Information
Use the dg_get_radio xe "dg_get_radio"  command to extract 
information from a radio button. This command returns the currently 
selected radio button in the set.

Modifying Radio Button Information
You change the active element with the dg_set_radio xe "dg_set_radio"  
command. You set or change the text string for a field with 
dg_set_radio_text xe "dg_set_radio_text" .

To change the number of buttons, delete the entity and add it again.

Sliders
 XE "dialog box entities:sliders"  XE "dialog box entities:scroll bars" Slider 
entities, more commonly known as scroll bars, have a draggable slider 
bar in the middle of the entity, and icons on either end.  Pressing either 
icon moves the slider one segment in that direction.  Pressing the area 
between an icon and the slider box causes the entity to "page" that 
number of segments.  Moving the slider bar, by holding down the mouse 
button, causes the slider to take up the new position specified.  You 
create a slider entity with the dg_add_slider xe "dg_add_slider"  
command.

Extracting Slider Information
You extract information from a slider entity with dg_get_slider XE 
"dg_get_slider" .  This command returns the current segment of the 
slider.

Modifying Slider Information
You change the active segments and other settings with 
dg_set_slider. XE "dg_set_slider" 

By default, the slider returns picks to you only if 
you specify a flag value of DG_RET_ON_SEL 
(0x0001) at creation.  When you drag the slider 
bar, the program does not notify you until you  
release the slider bar. To be notified as the user 
drags the slider, specify the flag value as 
DG_TRACK (0x0800) and DG_RET_ON_SEL 
(0x0001), which generate a press message every 
time the slider moves one or more pixels.



List Boxes
 XE "dialog box entities:list boxes" List boxes provide the mechanism for 
selecting a string from a potentially large set of strings. FILES, PART, 
LST LD is an example of a list box.  If the text passed to dg_add_list xe 
"dg_add_list"  omitted, the strings can be added later using 
dg_set_list_text XE "dg_set_list_text" .

Extracting List Box Information
You extract list box information with dg_get_list XE "dg_get_list" .  This 
command returns the index of the string chosen by the user.

To retrieve the actual text string of a selection, use the 
dg_get_list_text xe "dg_get_list_text"  command

Modifying List Box Information
To change the selected item, use dg_set_list XE "dg_set_list" . To set or 
change a list item, use dg_set_list_text XE "dg_set_list_text" .  If list item 
you select is greater than the number of items in the list, the list expands 
to the new amount.

To delete an item from the list, use dg_del_list_text XE 
"dg_del_list_text" .

Check Boxes
A check box provides a simple toggle.  To add a check box use the 
dg_add_check command.

Extracting Check Box Information
You extract information from a check box with dg_get_check XE 
"dg_get_check" .  This command returns the status of the specified check 
box.

Modifying Check Box Information
To change the state of a check box, use dg_set_check XE "dg_set_check" .

Combo Boxes
 XE "dialog box entities:combo boxes" A combo box is a list box with an 
attached input field.  The user selects an item from the list box or enters 
a string into the input field.  If the Must Exist flag is true, the user must 
select from the list.  If the input field is used, the typed string will force 
itself to match one of the list items.  If the text is omitted, use 
dg_set_combo_list_text xe "dg_set_combo_list_text"  to specify the text 
strings later. To add a combo box use the dg_add_combo xe 
"dg_add_combo"  command.

Extracting Combo Box Information
You extract information from a combo box with 
dg_get_combo_string xe "dg_get_combo_string"  or 
dg_get_combo_list_active XE "dg_get_combo_list_active" . The 
dg_get_combo_string command returns a string value of the specified 
combo box in the @STRDAT system array while 
dg_get_combo_list_active returns the list index of the active element of 
the specified combo box.

Modifying Combo Box Information
To set or change a list item in a combo box, use 
dg_set_combo_list_text XE "dg_set_combo_list_text" .  If the item's 
number  is greater than the current total number of items, the list 
expands to the new amount. 

To delete an item from the combo list, use dg_del_combo_list_text XE 
"dg_del_combo_list_text" .

To change the input string in a combo box, use dg_set_combo_string xe 
"dg_set_combo_string"  and to change the active list element and the 
input string in a combo box, use dg_set_combo_list_active XE 
"dg_set_combo_list_active" .


Tables
 XE "dialog box entities:tables" A table is made up of columns.  Each 
column can have its own width, input type, and printf format string.  
You create the global information for a table first, then specify each 
column.  You can also specify each cell individually.  To specify each cell 
individually, call dg_set_table_doubles XE "dg_set_table_doubles" , 
dg_set_table_ints xe "dg_set_table_ints"  or dg_set_table_strings xe 
"dg_set_table_strings"  for each column to set up columnar data such as 
printf format string and the colors, and pass a NULL in the vals field.  If 
you use this method to build the table, specify 0 for the 'maxrows' 
argument to dg_add_table XE "dg_add_table" , and use 
dg_add_table_row xe "dg_add_table_row"  to add each row of the table.

To create a table with multiline headers, you use the '&' character as a 
separator. For example, using 

slist $$ch[0] = "Initials&Values"
slist $$ch[1] = "Time","&Money"
will give a you a heading that looks like this:

Initial		Time
Values		Money

After adding the table, set up its columns.  To set up a column of integers 
use the dg_set_table_ints xe "dg_set_table_ints"  command. To set of a 
column of doubles use dg_set_table_doubles xe "dg_set_table_doubles"  
and to set of a column of strings use the dg_set_table_strings xe 
"dg_set_table_strings"  command.

Modifying Table Rows
To add a row to an existing table, use dg_add_table_row XE 
"dg_add_table_row" .  You can add rows only at the end of the table.
When you add a row, all string columns are set to the empty string, and 
integer and double columns are set to zero.

To delete a row from an existing table, use dg_del_table_row XE 
"dg_del_table_row" .

To invert a row in an existing table, use dg_invert_table_row XE 
"dg_invert_table_row" .  Use inverting for doing "multiple selection" of 
rows from within a table.  An inverted row swaps each cell's foreground 
and background colors in that row.  Therefore, inverting an inverted row 
returns it to normal.

Locking Columns
You can lock a column in two ways. You can either call 
dg_set_table_ints, doubles, or strings, with  dg_locked XE "dg_locked"  
specified as a flag;  or you can call dg_lock_table_col XE 
"dg_lock_table_col" . 

To unlock a column, use dg_unlock_table_col. XE "dg_unlock_table_col" 

A user cannot alter the contents of a locked column.  When he picks, he 
will receive a message back from the dialog box manager that the cell is 
locked.

Locking the entire table, by locking each column, and then using the 
dg_invert_table_row command after each user pick provides the basic 
mechanism for multiple selection of items from a table.

Setting Cells
These commands can be used to set individual cells to new values.  To 
set an integer cell use the dg_set_cell_int xe "dg_set_cell_int"  command. 
To set a double cell use dg_set_cell_double xe "dg_set_cell_double"  and 
to set a string cell use dg_set_cell_string XE "dg_set_cell_string" .

Extracting Table Information
To inquire about the value of a specific cell, use dg_get_cell_int XE 
"dg_get_cell_int" , dg_get_cell_double XE "dg_get_cell_double" , and 
dg_get_cell_string XE "dg_get_cell_string" .

To ask which cell was modified last, you will need to have set a flag 
value of DG_RET_ON_SEL (0x0001) for the table. Then to find out 
which cell was changed, use the dg_get_table_changed command XE 
"dg_get_table_changed" . It places into row and col the location of the 
last changed cell, or places -1 in row and col if nothing changed.


Icons
 XE "dialog box entities:icons"  XE "dg_add_icon" Icons are like buttons, 
but can contain a user-definable picture instead of text. To add an icon, 
call the dg_add_icon command.

Defining Icons
Icons must be an integer number of cells high and wide, but within the 
boundaries the coordinates of the entities that make up the icon are 
doubles.  For example, to define a 3x3 icon, your arguments to the entity 
commands range from 0.0,0.0 (the upper left corner) to 3.0,3.0 (the 
bottom right corner).

Icons anchor by their upper-left corner, and the 
y axis positive direction is downward.  


Following the name field is a list of the entities that make up the icon.  
Currently, four entities are supported: lines, boxes, bars, and polygons.

To define lines:

line color
x1 y1
x2 y2


Example

	line green
	0.0 0.0
	1.0 1.0

This draws a green line from the top left corner to the bottom right 
corner of the cell.  You define boxes and bars exactly like lines, 
substituting the word bar or box for line.

To define polygons you use:

pgon color nvert
x1  y1
x2  y2
.....
xn  yn

where nvert is the number of vertices in the polygon and each x and y 
coordinate is for each of the vertices, in the order they are to be 
connected.  


The following example shows the icon definition for a 3x3 character 
yield sign, with a white background, upside down yellow triangle, with a 
black border.

yield 5 3 3
bar white
0.0 0.0
3.0 3.0
pgon yellow 4
0.5 0.5
2.5 0.5
1.5 2.0
0.5 0.5
line black
0.5 0.5
2.5 0.5
line black
2.5 0.5
1.5 2.0
line black
1.5 2.0
0.5 0.5

Extracting Icon Information
There is nothing to extract. The dialog box manager notifies users when 
the icon is pressed.


Titles
 XE "dialog box entities:titles"  XE "dg_add_title" Any entity can have a 
title.  You can add a title to any entity after you create it.  The r and c 
values for this command are relative to the entity not absolute. To add a 
title use the dg_add_title command.


Deleting Entities

 XE "dialog boxes: deleting entities"  XE "dialog box entities:deleting"  XE 
"dg_del_ent" To remove an entity from a dialog box, use dg_del_ent.  
After you delete an entity, you can reuse its index number for a new 
entity.


Errors In Creation And Modification

 XE "dialog boxes:errors"  XE "dialog box entities:errors" There are many 
reasons why the dialog box manager returns errors.  These include: 
modifying the wrong index, for example, calling dg_set_cell_string on 
an entity which isn't a table; indexing out of bounds; or other errors.  The 
dialog box manager uses the system variable @ERROR to pass back error 
status.  The variable sets to zero upon successful completion of any 
dialog box manager command.

@ERROR is cleared after any successful call, so examine it after every 
dialog box manager call.


Freezing A Dialog Box

 XE "dialog boxes:freezing"  XE "dg_freeze_dialog" Occasionally, you can 
make major changes to the dialog box, for example, resetting values in a 
file list box when the user changes directories.  In these cases, you should 
stop all dialog box updates until the changes are completed. Call 
dg_freeze_dialog to freeze a dialog box.  To refresh the screen, call 
dg_draw_dialog xe "dg_draw_dialog"  when the updates are finished.  
This clears the frozen bit from the dialog box.

Running the Dialog Box

 XE "dialog boxes:running" Once you create a dialog box and add all of 
your entities, you can draw the dialog box and get user input.

To draw the dialog box call dg_draw_dialog, then use dg_run_dialog. It 
 xe "dg_run_dialog" returns an integer, which is the index of the button 
that the user pressed.  Also, it could be the index of any other field if you 
set the flag value to DG_RET_ON_SEL (0x0001) flag for that field and 
change it.
Keyboard Bindings
 XE "dialog boxes:keyboard bindings"  XE "dialog box entities:keyboard 
bindings" You can assign the command keys F1 through F9 and the keys 
Alt-A through Alt-Z to entities.  Because dg_run_dialog disables 
immediate mode commands, this should not cause any conflicts.

You can bind the keys to button and check box entities in one of two 
ways.  The command, dg_add_binding, xe "dg_add_binding"  binds the 
specified key to the specified button or check box entity.  If the user 
presses the bound key, the entity behaves exactly as if it was pressed by 
the mouse; it gains the focus.  XE "focus" 

The second way to bind a key to a button or check box is by preceding 
the selected key in the entity's text with an ampersand '&', e.g., if the 
button text is "List Files" add a '&' character "List &Files". This will 
creates a button that is also bound to the Alt-F key.

To bind a key to combo boxes, input fields, radio buttons, or list boxes, 
you must precede the selected key in the title of the entity by an 
ampersand '&', e.g,  "Paper &X Offset"  creates a bind between Alt-X and 
the entity which is titled "Paper X Offset".

If you use dg_add_binding, the key that is bound to the entity is not 
visible.  If you use the ampersand method, the selected key is underlined 
in the text or title field.

Do not bind a key to more than one entity.  

Selecting the Focus
 XE "dialog boxes:focus"  XE "dialog box entities:focus" The dialog box 
manager always knows which entity has the focus.  The entity with the 
focus has priority for  keyboard input and mouse picks.  For example, if 
you have a drop down combo box that overlays other fields when it 
drops, the manager knows that mouse picks go first to the combo box, 
and not to the obscured entities, because its attention is focused on that 
object.  The focus shifts with mouse picks, by tab key presses, or directly 
by programmer control.  

For example, if you have a check box to select whether or not an 
operation sends its result to the printer or to a file, the space to enter the 
file name should be frozen if printer is selected, and open if the file 
option is picked.  When the check box is set to file, the file name box 
should be unfrozen and the user's next keyboard input should go to that 
field. The command dg_move_focus xe "dg_move_focus"  redirects the 
dialog box manager's attention to the specified field.  You can use this 
code before a dialog box is run for the first time.  For example, when you 
display a "File/List/Load" box, the File Name field could be defined as 
having the focus. 

Accessing CDE Modules

A CDE module can be loaded using the CDEOPEN  XE "CDEOPEN 
" command.  This command works the same way as the FILES-CDE-
LOAD menu sequence.  A CDE module can be closed by the CDECLOSE 
 XE "CDECLOSE " command, which is equivalent to the FILES-CDE-
CLOSE menu sequence.  

Functions in CDE modules can be accessed from CADL programs.  If a 
CDE module is already loaded, its functions can be called directly from 
CADL if the arguments and return types for these functions use data 
types supported by CADL.  For example, functions that use structures 
cannot be called from CADL.  User defined types are acceptable as long 
as they reduce to the supported types.

The following type are supported by CADL for arguments to CDE 
function calls (the type in parenthesis is the CADL data type 
corresponding to the CDE type):

char (char)	char* (string)
unsigned char (uchar)	char** (slist for argument only, not for 
return type)
int (int)	unsigned int (uint)
short (short)	unsigned short (ushort)
long (long)	unsigned long (ulong)
float (float)	double (double)

For example, if a CDE module has the following definition for a function:

typedef int BOOLEAN;
int my_func1 (double x, double y, double z, BOOLEAN flag);
 
it can be called from CADL with the following syntax:

my_func1 x, y, z, flag

where x, y, and z are floating point values and flag is an integer value.  
The values must fall within the expected ranges for the function, or a 
runtime error will occur.


____________________________________________________________________________

Section Three: Reference

Table of Contents

ABORT	
ADDCOLL	
ADDCOP	
ADDCTYPE
ANGDIM	
ARC	
ARRAY	
AUTO	
BURSTCOLL
CALL	
CDECLOSE
CDEOPEN	
CHAIN	
CIRCLE	
CIRDIM	
CLEAR	
CLEARHST
CLEARSEL
CLOSE	
CLS	
CMOVE	
CODE	
CONIC	
CREAD	
CWRITE	
DBLSCL	
DEFATTR	
DELCOP	
DELCTYPE
DELENT	
dg_add_binding	
dg_add_box
dg_add_button
dg_add_check
dg_add_combo
dg_add_icon
dg_add_list
dg_add_note
dg_add_radio
dg_add_slider
dg_add_table
dg_add_table_row
dg_add_text_double
dg_add_text_int
dg_add_text_string
dg_add_title
dg_child_dialog
dg_del_combo_list_text
dg_del_ent
dg_del_list_text
dg_del_table_row
dg_draw_dialog
dg_erase_dialog
dg_free_dialog
dg_freeze_dialog
dg_get_box_rc
dg_get_cell_double
dg_get_cell_int
dg_get_cell_string
dg_get_check
dg_get_colors
dg_get_combo_list_active
dg_get_combo_string
dg_get_flags
dg_get_icon_rc
dg_get_list
dg_get_list_text
dg_get_note
dg_get_radio
dg_get_slider
dg_get_table_changed
dg_get_table_invert_status
dg_get_text_double
dg_get_text_int
dg_get_text_string
dg_init_dialog
dg_inq_dialog_wh	
dg_invert_table_row
dg_lock_table_col
dg_move_focus
dg_radio_align
dg_run_dialog
dg_set_button_border
dg_set_cell_double
dg_set_cell_int
dg_set_cell_string
dg_set_check
dg_set_colors
dg_set_combo_list_active
dg_set_combo_list_text
dg_set_combo_string
dg_set_flags
dg_set_list
dg_set_list_text
dg_set_note	
dg_set_radio
dg_set_radio_text
dg_set_slider
dg_set_table_doubles
dg_set_table_ints
dg_set_table_strings
dg_set_text_double
dg_set_text_int
dg_set_text_string
dg_set_title
dg_unlock_table_col
DOSUB	
DRAWENT	
EXEC	
EXIT
FNOTE
GENDIM
GETALL
GETCOLOR
GETCOP	
GETCUR
GETENT
GETENTID
GETENTM
GETENTXY
GETFLT
GETGROUP
GETINT
GETKEY
GETLTYPE	
GETLWIDH
GETMENU
GETNEXT
GETPLANE
GETPOS
GETSTR
GETVIEW	
GOTO
GROUP
HALF
IF
INPUT
INQCTYPE
INQTCODE
LABEL
LEADER
LEVELS
LINDIM
LINE
MAKECOLL
MODE
NEXTCOLL
NFNOTE
NLABEL	
NLEADER	
NNOTE
NOTE
NWITNESS
ON GOTO
ORDALIGN
ORDDIM
PALETTE	
PAUSE
POINT
POLYGON
POLYLINE
PRANGE
PRINT
PROMPT
READ
READDEV
REDRAW
REM
REMCOLL
SCALE
SET
SETATTR	
SETCUR
SETNOTE
SPLINE
SPRINT
sys_addvp
sys_autovp
sys_delvp
sys_get_name
sys_inqtbsize
sys_inqvpdef
sys_inqvpinfo
sys_movevp
sys_prt_desc_inq
sys_prt_desc_set
sys_prt_load
sys_prt_save
sys_ptn_load
sys_ptn_save
sys_put_name
VIEW	
VLINE
VPOINT
VPOLYGON
WAIT
WINDOW
WITNESS
WRITE
XHATCH	


ABORT
ABORT  XE "program control statements:ABORT " causes an immediate 
exit from CADL processing, and control is returned to the CADKEY 
program. Use EXIT to backup one DOSUB level.
 XE "ABORT" 

Format:
ABORT

ADDCOLL
 XE "collectives:adding an entity" Add an entity to a collective or 
combine collectives.
 XE "ADDCOLL" 
	
Format:
ADDCOLL id1, id2

Input Parameters:
id1 (ulong)	ID of an entity in the collective being added to.

id2 (ulong)	ID of the entity to add to the collective. If the 
entity belongs to another collective, the two 
collectives will merge.

Output Parameters:
none

System Variables Set:
@ERROR(ivar)	Error Code:
	0 = No error
	-23 = Entity cannot be made into a collective


ADDCOP
ADDCOP  XE "copious commands:adding a copious entity"  XE 
"ADDCOP " creates a copious entity of a given size.  The size of the 
entity is determined by using the special calculator function copsize().  
Initially, all values in the entity (whether characters, doubles, integers, 
etc.) are zero.  Once created, values can be written to or read from the 
entity using the CWRITE and CREAD commands. There are no 
restrictions as to the order of the values; however, values should be read 
in the same order that they were written, otherwise the results are 
unpredictable.

Format:
ADDCOP tcode,size

Input Parameters:
tcode (ival)	Entity type code

size (ival)	Size of entity

Output Parameters:
none

System Variables Set:
@ERROR (ivar) 	Error Code:
	0 = No error
	1 = Type does not exist
	2 = Invalid size

@CID (ivar)	ID assigned to entity
@CTCODE (ivar)	Entity type code
@CSIZE (ivar)	Entity size


ADDCTYPE
ADDCTYPE  XE "copious commands:adding entity types"  XE 
"ADDCTYPE " creates a new copious entity type (classification) 
identified by a specified name (a character string). Up to 256 types may 
be defined in any given part file.  When a type is created, a "type code" is 
assigned and returned.  The code is needed later for use with CADL 
commands that access copious entities.  The purpose of using codes is 
one of convenience - it's simply easier to deal with numbers than with 
strings.  Once a code is assigned, it remains so until the copious entity 
type is deleted.  However, the number of copious entity types and the 
order in which they are added affects the assigned code values. This 
means that it is very unlikely two parts will have the same code 
assignments.  Consequently, the codes MUST be reestablished at each 
invocation of CADL.  Use INQTCODE to determine the type code of an 
existing copious entity type.

Format:
ADDCTYPE name, tcode

Input Parameter:
name (string)	Name of copious entity type to add. Up to 19 
characters can be specified.

Output Parameter:
tcode (ivar)  	Variable in which to store returned type code.  If 
the type being added already exists, the existing 
type code is returned.

System Variables Set:
@ERROR (ivar)   	Error Code:
	0 = No error
	1 = Type already exists 
	2 = Too many types


ANGDIM
The ANGDIM  XE "detail entities:angular dimension"   XE 
"primitives:ANGDIM"  XE "ANGDIM" primitive describes an angular 
dimension entity. All ANGDIM data is represented in local view 
coordinates.

When an ANGDIM primitive is read from a CADL file, an angular 
dimension entity is created in the database. 

When an ANGDIM entity is written to a CADL file as an ANGDIM 
primitive, a VIEW primitive is created first. In addition to a VIEW 
primitive, some arrays are created. These arrays are used for the 
ANGDIM definition.

When an ANGDIM primitive is read from a CADL file, all the arrays 
except refln are optional. ANGDIM requires two reference lines.  The 
system calculates the angle between the two reference lines defined in 
the refln array. If a special value/string is desired in place of the 
numeric value of the angle then the string should replace the parameter 
'str'.


Format:
ANGDIM	x, y, z, str, refln, dimval, [txtinfo], [diminfo1], 
[diminfo2], [txtatt], [entatt]

Input Parameters:
x (double)	X value of the lower left corner of the dimension text 
in the view coordinates

y (double)	Y value of the lower left corner of the dimension text 
in the view coordinates

z (double)	Z value of the lower left corner of the dimension text 
in the view coordinates

str (string)	A character string.  If it is omitted, the dimension 
value is calculated and displayed.

refln(farray)	Array of floats that defines the coordinates of the 
reference lines. Each ANGDIM requires two reference 
lines. For more detail refer to the System Arrays 
section.

dimval(integer)	A flag that defines angle type:
	1 = Acute angle (< 180)
	0 = Obtuse angle (> 180)

txtinfo(iarray) 	An array of integer values that describes the 
information for the dimension text. The array is not 
required if the value of 'str' is NULL. For more detail 
refer to the System Arrays section.

diminfo1(iarray)	An array of integer values that is used for the 
dimension. For more detail refer to the System Arrays 
section.
diminfo2(farray)	An array of floats that is used for the dimension. For 
more detail refer to the System Arrays section.

txtatt(farray)	An array of floats that describes the attributes of the 
dimension text. The array is not required if the value 
of 'str' is NULL. For more detail refer to the System 
Arrays section.

entatt(iarray) 	An array of integer values that describes the attributes 
of the entity.  For more detail refer to the System 
Arrays section.

Output Parameters:
none

System Variables Set:
none


ARC
The ARC  XE "primitives:ARC "  XE "ARC " primitive describes a circular 
arc defined in a specified plane. All ARC data is represented in local 
view coordinates.

When an ARC primitive is read from a CADL file, an arc entity is 
created in the database. 

When an arc entity is written to a CADL file as an ARC primitive, a 
VIEW primitive is created first (if necessary) which the ARC primitive 
may reference as its definition plane.


Format:
ARC xc, yc, zc, rad, ang1, ang2, [vnum], [col], [lev], [ltype], [grpnum], 
[subgrp], [pen], [lwdt]


Input Parameters:
xc (double)	X value of arc's center in arc's view coordinates

yc (double) 	Y value of arc's center in arc's view coordinates

zc (double) 	Z value of arc's center in arc's view coordinates

rad (double)	Radius value of the arc in the current system units 
	rad must be >= 0.0005 and <= 10,000

ang1 (double) 	Starting angle of arc segment  
	ang1 must be >= 0 and <= 360 degrees

ang2 (double) 	Ending angle of arc segment
	ang2 must be >= 0 and <= 360 degrees

vnum (integer) 	VIEW primitive reference number. The VIEW 
primitive referenced must precede this primitive or an 
error message is displayed and the program 
terminates.
	0 = Use current system view in effect

col (integer) 	Color
	0-15 = Number in the system color palette

lev (integer) 	Level number
	1-256 = System level number
	0 = Use current level number

ltype (integer) 	Line type:
	1 = Solid
	2 = Dashed
	3 = Center Line
	4 = Phantom Line
	0 = Use current system line type

grpnum (integer) 	Group reference number
	1-127 = Group number assigned 
	0 = No group assignment

subgrp (integer)  	Subgroup reference number 
	1-256 = Subgroup number assigned 
	0 = No subgroup assignment

Note : If you wish to specify a group, you must include 
both the group and the subgroup number.  If either of 
these arguments is missing or set to zero(0), both of 
them will be ignored.

pen (integer) 	Pen number
	1-8 = Pen number
	0 = Use current system pen number in effect

lwdt (integer) 	Line width
	1-15 = Odd line width
	0 = Use current system line width


Output Parameters:
none

System Variables Set:
none


ARRAY
Array XE "ARRAY" s allow data to be assigned to a single or multi-
dimensional storage array within a CADL program. Data may be 
assigned to an array anywhere within a CADL file, as long as it is 
assigned before the array is used. The limit to the number of dimensions 
in an array is five. 


To declare an array, you must use one of the following formats:

Format 1:	ARRAY arrayname[n]={n1, n2, n3...}     

Format 2:	ARRAY arrayname[n]
	..
	arrayname[0] = n1
	arrayname[1] = n2
	..


To declare an array, you must use ARRAY, followed by the array's name.  
Following the arrayname on the line is a number enclosed in square 
brackets, representing the dimensional size. Up to five sets of brackets 
may be used.  One set of brackets represents a single-dimensional array; 
two sets represent a two-dimensional array; three sets represent a three-
dimensional array.  The size of the array can also be specified using a 
variable.

Once you've declared the array, you can set the elements of the array on 
the same line by following the dimension size(s) with an equals sign (=) 
and then a list of the elements, separated by commas and surrounded by 
curly braces { } (See Format 1).  When using this type of initialization for 
arrays, the elements in the list must be numeric values; they cannot be 
variables or expressions.  For multi-dimensional arrays, data is stored by 
switching the last dimension first, and then continuing up to the first 
dimension. (See Array Declaration Examples.)  

If you don't wish to set the array initially, but would rather set it later in 
your program, you may assign values to the array elements by using 
Format 2. When assigning values to array elements in this fashion, the 
elements may be assigned with variables along with numeric values.  
Note that when you are setting the values of an array, the elements are 
numbered from 0 to (n-1), NOT from 1 to n.

You can declare an array even if it has already been declared once.  You 
can change the size of each dimension and even the number of 
dimensions; however, by doing this, you will lose all the data that you 
previously stored in the array.


Examples
To define a one-dimensional array of five values, either of the following 
formats will create the same array: 

int data [0]
ARRAY data [5] = {0, 1, 2, 3, 4}


OR


int data [0]
ARRAY data [5]
data [0] = 0
data [1] = 1
data [2] = 2
data [3] = 3
data [4] = 4

To define a two-dimensional array of three rows and two columns, both 
of the following formats will create the same array: 

int data [3][2]
ARRAY data [3][2] = {0, 1, 2, 3, 4, 5}


OR


int data [0][0]
ARRAY data [3][2]
data [0][0] = 0
data [0][1] = 1
data [1][0] = 2
data [1][1] = 3
data [2][0] = 4
data [2][1] = 5


AUTO
AUTO  XE "viewports:automatic part scaling"  XE 
"scaling:automatic"  XE "AUTO " automatically scales the current part to 
fit in the viewport. This performs the same function as using the 
system's Immediate Mode command, except that an automatic redraw is 
not performed. 

Format:
AUTO [vpnum]

Input Parameter:
vpnum (ival)	Viewport number:
	-1 = All viewports
	0 or default = Primary viewport
	positive number = Designated viewport

Output Parameters: 
none

System Variables Set:
none


BURSTCOLL
 XE "BURSTCOLL"  XE "collectives:removing all entities" Remove all 
entities from collective.


Format:
BURSTCOLL id

Input Parameter:
id (unsigned long)	ID of an entity inside the collective

System Variables Set:
none


CALL
CALL  XE "CALL " provides a mechanism for invoking an internal 
CADKEY function. A collection of functions is provided that helps 
reduce the size and complexity of CADL files by performing commonly 
used operations. 


Format:
CALL func, arg1, ...


Input Parameters:
func (word)  	Function name (see following pages)

Additional parameters are function-dependent.
Output Parameters:
Function-dependent


System Variables Set:
@ERROR (ivar) 	Error Code: 
	0 = No error
	1 = Error accessing an argument
	2 = Called function error
	

CALL Functions

Here is a list of functions accessible through the CALL statement. Except 
for strings, all input and output arguments are floating point values, 
unless otherwise noted. An actual string (e.g., "This is a string") can be 
used as an argument if it is passed to the called function, but not 
returned. For example, the contents of a string variable can now be 
directly compared to a string:

call strcmp, $file, "myfile.dat", retval



 XE "ATAN3"  XE "CALL:ATAN3" CALL	atan3, y, x, r

Calculate the arc tangent of y/x .  This function works correctly 
in all four quadrants.

Input Parameters:
	y - y value
	x - x value

Output Parameter:
	r - arc tangent of y/x in the range of 0.0 to 2p.

Error:
	None



 XE "CDLV2SYSV"  XE "CALL:CDLV2SYSV" CALL	cdlv2sysv, cv, 
sv

Convert a CADL reference view number to system view number.

Input Parameter:
	cv - CADL reference view number

Output Parameter:
	sv - system view number

Error:
	1 - unknown CADL reference view number 
 XE "CROSS"  XE "CALL:CROSS" CALL	cross, rx, ry, rz, x1, y1, 
z1, x2, y2, z2

Calculate the cross product of two vectors, (x1, y1, z1) and (x2, 
y2, z2).

Input Parameters:
	x1 - x value of first vector
	y1 - y value of first vector
	z1 - z value of first vector
	x2 - x value of second vector
	y2 - y value of second vector
	z2 - z value of second vector

Output Parameters:
	rx - x result
	ry - y result
	rz - z result

Error:
	None



 XE "DOTPROD"  XE "CALL:DOTPROD" CALL	dotprod, x1, y1, 
z1, x2, y2, z2, r

Calculate the dot product of two vectors, (x1, y1, z1) and (x2, y2, 
z2).

Input Parameters:
	x1 - x value of first vector
	y1 - y value of first vector
	z1 - z value of first vector
	x2 - x value of second vector
	y2 - y value of second vector
	z2 - z value of second vector

Output Parameter:
	r - dot product result

Error:
	None

 XE "INQ_VP_NDC"  XE "CALL:INQ_VP_NDC" CALL
	inq_vp_ndc, vp, x1, y1, x2, y2

Inquire about the normalized device coordinates (NDC) of a 
specific viewport based on the entire screen.
(Refer to the SYS_INQVPDEF command)

Input Parameter:
	vp - viewport number

Output Parameters:
	x1 - x value of lower left corner of viewport
	y1 - y value of lower left corner of viewport
	x2 - x value of upper right corner of viewport
	y2 - y value of upper right corner of viewport

Error:
	1 - unknown viewport number



 XE "MEMCPY"  XE "CALL:MEMCPY" CALL	memcpy, dst, didx, src, 
sidx, cnt
	
Copy one or more elements from a one dimensional source array 
(starting at the source index) to a one dimensional destination 
array (at the destination index).

Input Parameters:
	didx (ival) - destination array index
	src (val) - source array
	sidx (ival) - source array index
	cnt (ival) - count of elements to copy

Output Parameter:
	dst (val) - destination array

Errors:
	1 - source or destination not one dimensional array
	2 - index or count out of range



 XE "STRCAT"  XE "CALL:STRCAT" CALL	strcat, s1, s2

Concatenate string s2 onto the end of string s1.

Input Parameters:
	s1 - first string
	s2 - second string

Output Parameter:
	s1 - string 2 concatenated onto string 1

Errors:
	1 - unable to access/create a string variable
	2 - string overflow


 XE "STRCMP"  XE "CALL:STRCMP" CALL	strcmp, s1, s2, r

Calculate a case sensitive comparison of the two strings, s1 and 
s2.

Input Parameters:
	s1 - first string
	s2 - second string

Output Parameters:
	r - 	integer result of comparison of s1 with s2:
	Zero means the two strings match.
	A positive value means s1 is of greater value than s2 
at the nonmatching character.
	A negative value means s2 is greater than s1 at the 
nonmatching character.

Errors:
	1 - unable to access a string variable
	2 - string overflow



 XE "STRCMPI"  XE "CALL:STRCMPI" CALL	strcmpi, s1, s2, r

Calculate a case-insensitive comparison of the two strings, s1 
and s2.

Input Parameters:
	s1 - first string
	s2 - second string

Output Parameter:
	r - 	integer result of comparison of s1 with s2. 
		Zero means strings match.
		Positive value means s1 is of greater value than s2 at 
first nonmatching character. 
		Negative value means s2 is greater than s1.

Errors:
	1 - unable to access a string variable
	2 - string overflow

 XE "STRCPY"  XE "CALL:STRCPY" CALL	strcpy, s1, s2

Copy string s2 into string s1.

Input Parameter:
	s2 - source string

Output Parameter:
	s1 - destination string (copy of source string)

Errors:
	1 - unable to access/create a string variable
	2 - string overflow



 XE "STRLEN"  XE "CALL:STRLEN" CALL	strlen, str, len

Determine the length of the string, str.  This length does not 
include the null terminator.

Input Parameter:
	str - string

Output Parameter:
	len - length of string 

Error:
	1 - unable to access a string variable



 XE "STRFLT"  XE "CALL:STRFLT" CALL	strflt, str, flt

Convert a string to a floating point value.

Input Parameter:
	str - string to convert

Output Parameter:
	flt - converted floating point number

Error:
	None

 XE "STRINT"  XE "CALL:STRINT" CALL	strint, str, int

Convert a string to an integer value.

Input Parameter:
	str - string to convert

Output Parameter:
	int - converted integer number

Error:
	None


 XE "XFVW"  XE "CALL:XFVW" CALL	xfvw, vx, vy, vz, wx, 
wy, wz

Transform the view coordinates (vx, vy, vz) to world 
coordinates (wx, wy, wz) using the current view matrix

Input Parameters:
	vx - view x value
	vy - view y value
	vz - view z value

Output Parameters:
	wx - world x value
	wy - world y value
	wz - world z value
Error:
	None



 XE "XFWV"  XE "CALL:XFWV" CALL	xfwv, wx, wy, wz, vx, 
vy, vz

Transform the world coordinates (wx, wy, wz) to view 
coordinates (vx, vy, vz) using the current view matrix

Input Parameters:
	wx - world x value
	wy - world y value
	wz - world z value

Output Parameters:
	vx - view x value
	vy - view y value
	vz - view z value

Error:
	None



 XE "XFMVW"  XE "CALL:XFMVW" CALL	xfmvw, m, vx, vy, vz, 
wx, wy, wz

Transform the view coordinates (vx, vy, vz) to world 
coordinates (wx, wy, wz) using the specified view matrix

Input Parameters:
	m - transformation matrix
	vx - view x value
	vy - view y value
	vz - view z value

Output Parameters:
	wx - world x value
	wy - world y value
	wz - world z value

Error:
	1 - unable to access view matrix



 XE "XFMWV"  XE "CALL:XFMWV" CALL	xfmwv, m, wx, wy, wz, 
vx, vy, vz

Transform the world coordinates (wx, wy, wz) to view 
coordinates (vx, vy, vz) using the specified view matrix

Input Parameters:
	m - transformation matrix
	wx - world x value
	wy - world y value
	wz - world z value

Output Parameters:
	vx - view x value
	vy - view y value
	vz - view z value

Error:
	1 - unable to access view matrix


CDECLOSE
CDECLOSE  XE "CDECLOSE " allows you to close an already opened 
CADKEY Dynamic Extension (CDE) module from within the current 
CADL program. This function is useful when too many CDE modules are 
opened.

The file specification is processed as follows: 1) if the specification does 
not include a path, the directory of the CDE file is defined in CDEPATH; 
2) if a full path is included, the specified directory is used; 3) if the 
specification includes a relative path, the specified directory is relative 
to the directory of the initial CDE path; except 4) if the relative path 
begins with either "." or "..". In this case, the specified directory is relative 
to the same directory as the CADL program containing the CDECLOSE 
command. The ".cde" file extension is always forced. When specifying a 
path, the use of forward slashes (/) or backslashes (\)  is dependent 
upon the operating system under which CADKEY is running. In the 
event of an error (namely, the specified file does not exist), execution 
from within the current CADL file is terminated. 

For more information about CDE refer to the CADKEY Software 
Development Kit (SDK) Manual.


Format:
CDECLOSE fname


Input Parameter:
fname (string)	File name of CDE module


Example: 
CDECLOSE "primtv"


CDEOPEN
CDEOPEN  XE "CDEOPEN " allows you to open a CDE module from 
within the current CADL file. After opening a CDE module, all the 
functions defined in the definition (.DEF) file can be called as commands 
in the CADL program. The CDE module remains in memory, until the 
CADKEY program is terminated or the CDE module is closed.

The file specification is processed as follows: 1) if the specification does 
not include a path, the directory of the CDE file is defined in CDEPATH; 
2) if a full path is included, the specified directory is used; 3) if the 
specification includes a relative path, the specified directory is relative 
to the directory of the initial CDE path; except 4) if the relative path 
begins with either "." or "..". In this case, the specified directory is relative 
to the same directory as the CADL program containing the CDEOPEN 
command. The ".cde" file extension is always forced. When specifying a 
path, the use of forward slashes (/) or backslashes (\)  is dependent 
upon the operating system under which CADKEY is running. In the 
event of an error (namely, the specified file does not exist), execution 
from within the current CADL file is terminated. 


Format:
CDEOPEN fname

Input Parameter:
fname (string)	File name of CDE module


CHAIN
 XE "CHAIN" CHAIN  XE "program control statements:CHAIN " allows 
you to switch control from the current CADL file being executed to 
another CADL file. When chaining occurs, execution continues with the 
first statement in the specified file and no return to the original file (as 
with DOSUB) is made. 


Format:
CHAIN fname 


File Specification:
The file specification is processed as follows: 

1) 	If a full path is included, the specified directory is used.

2)	If the specification includes a relative path, the specified directory is 
relative to the directory of the initial CADL program; except if the 
relative path begins with either "." or "..". In this case, the specified 
directory is relative to the same directory as the CADL program 
containing the CHAIN command. 

3)	If no path is specified, the directory is assumed to be the same as the 
initial CADL program (i.e., the program run from the CADKEY 
menus).


The ".cdl" file extension is always forced. 

When specifying a path, the use of forward slashes (/) or backslashes (\)  
is dependent upon the operating system under which CADKEY is 
running. 

In the event of an error (namely, the specified file does not exist), 
execution from within the current CADL file is terminated. 
 

CIRCLE
The CIRCLE  XE "primitives:CIRCLE "  XE "CIRCLE " primitive describes 
a complete 360 degree circular arc defined in a specified plane. All of the 
characteristics of an ARC primitive apply to a CIRCLE primitive, except 
that the start and end angle parameters are omitted.

Format:
CIRCLE xc, yc, zc, rad, [vnum], [col], [lev], [ltype], [grpnum], [subgrp], 
[pen], [lwdt]


Input Parameters:
xc (double) 	X value of the circle's center in circle's view 
coordinates

yc (double)	Y value of the circle's center in circle's view 
coordinates

zc (double) 	Z value of the circle's center in circle's view 
coordinates

rad (double)	The radius of the circle in the current system units
	rad must be <= 0.0005 or >= 10,000

vnum (integer)	VIEW primitive reference number. The VIEW 
primitive referenced must precede this primitive or an 
error message is displayed and the program 
terminates.
	0 = Use current view number in effect

col (integer) 	Color
	0-15 = Number in the system color palette

lev (integer) 	Level number 
	1-256 = System level number
	0 = Use current system level number

ltype (integer) 	Line type:
	1 = Solid
	2 = Dashed
	3 = Center Line
	4 = Phantom Line
	0 = Use current system line type

grpnum (integer)	Group reference number
	1-127 = Group number assigned 
	0 = No group assignment

subgrp (integer)	Subgroup reference number
	1-256 = Subgroup number assigned 
	0 = No subgroup assignment

Note : If you wish to specify a group, you must include 
both the group and the subgroup number.  If either of 
these arguments is missing or set to zero (0), both of 
them will be ignored.

pen (integer)  	Pen number
	1-8 = Pen number
	0 = Use current system pen number

lwdt (integer)	Line width
	1-15 = Odd line width
	0 = Use current system line width
Output Parameters:
none


System Variables Set:
none


CIRDIM
The CIRDIM  XE "detail entities:circular dimension"  XE 
"primitives:CIRDIM "  XE "CIRDIM " primitive describes a circular 
dimension entity. All CIRDIM data is in local view coordinates. 

When a CIRDIM primitive is read from a CADL file, a circular 
dimension entity is created in the database. 

When a circular dimension entity is written to a CADL file as a CIRDIM 
primitive, a VIEW primitive is created first. In addition to a VIEW 
primitive, some arrays are created for the CIRDIM definition.

When a CIRDIM primitive is read from a CADL file, all of the arrays 
except refarc are optional. The circular dimension entity requires one 
reference arc.  Based on the reference arc definition in the refarc array, 
the system calculates the radius or diameter of the arc/circle. If a special 
value/string is desired in place of the numeric value of the dimension 
then the string should replace the parameter 'str'.

Format:
CIRDIM 	x, y, z, str, refarc, [refpnt], form, [txtinfo], [diminfo1], 
[diminfo2], [txtatt], [entatt]


Input Parameters:
x (double) 	X value of the lower left corner of the dimension text 
in the view coordinates

y (double)	Y value of the lower left corner of the dimension text 
in the view coordinates

z (double)	Z value of the lower left corner of the dimension text 
in the view coordinates

str (string)	A character string. If it is omitted, the dimension 
value is calculated and displayed.

refarc(farray)	Array of floats that defines the coordinates of the 
reference arc. Each CIRDIM requires only one 
reference arc. For more detail refer to the System 
Arrays section.

refpnt(farray) 	Array of floats that defines the coordinates of the 
reference points. If the CIRDIM has form 3 (Bent 
radial circular dimension) , then each CIRDIM 
requires three reference points. For more detail refer 
to the System Arrays section.

form(integer)	Dimension form:
	1 = Radial circular dimension
	2 = Diametral circular dimension
	3 = Bent radial circular dimension


txtinfo(iarray) 	An array of integer values that describes the 
information for the dimension text. The array is not 
required if the value of 'str' is omitted. For more 
detail refer to the System Arrays section.

diminfo1(iarray) 	An array of integer values that is used for the 
dimension. For more detail refer to the System Arrays 
section.

diminfo2(farray) 	An array of floats that is used for the dimension. For 
more detail refer to the System Arrays section.

txtatt(farray) 	An array of floats that describes the attributes of the 
dimension text. The array is not required if the value 
of 'str' is NULL. For more detail refer to the System 
Arrays section.

entatt(iarray) 	An array of integer values that describes the 
attributes of the entity. For more detail refer to the 
System Arrays section.


Output Parameters:
none


System Variables Set:
none
CLEAR
 XE "CLEAR" Once variables are defined, they remain defined until the 
CADKEY program is terminated. This causes all variables to be global 
and therefore, they can be used across different CADL files. However, 
under some conditions, too many unused variables may be defined, 
preventing new variables from being created. The CLEAR statement can 
be used to remove (undefine) selected variables, or all variables if no 
arguments are given. Used at the beginning of a CADL file, CLEAR 
insures that all variable space is available for use. 


Format:
CLEAR [var1,...]


Input Parameter:
var1 (var)	Name of the first variable


CLEARHST
CLEARHST  XE "CLEARHST " clears the CADKEY history line from the 
specified position to the end of the line.


Format:
CLEARHST [depth]


Input Parameter:
depth (ival)	The depth from which to clear the history line 
(1-n). If this is omitted, the entire history line is 
cleared.


CLEARSEL
CLEARSEL  XE "CLEARSEL " clears the selection flag of entities that 
have been previously selected by the GETENTM command and have not 
been subsequently processed by the GETNEXT command. Normally, 
GETNEXT clears the selection flag. However, when an exit is made from 
CADL before GETNEXT has processed all of the selected entities, the 
unprocessed entities will not be selectable by CADKEY functions. To 
prevent this from happening, use CLEARSEL whenever this kind of 
premature exit from CADL is made.

Normally, CLEARSEL is directed to only clear the selection flags of 
entities in this list. This can be a problem if GETENTM is called multiple 
times (through programming error or otherwise) or an exit is made from 
CADL, CADKEY selection functions were performed, and then CADL 
was run again without proper cleanup. In this case, the selection list 
contains the currently selected entities with previously selected entities 
no longer on the list. When this occurs, CLEARSEL must be directed to 
clear the selection flags of all the entities in the database.


Format:
CLEARSEL [mode]

Input Parameter: 
mode (ival)	Clear mode:
	0 = Use selection list
	1 = All entities in database



CLOSE
CLOSE  XE "CLOSE " closes either DEVIN, DEVOUT, or a data file. Data 
files are normally closed only at CADL termination or whenever the 
EXEC command is processed. This command can be used to close a data 
file at any other time. DEVIN and DEVOUT are normally closed only at 
CADL termination. Closing DEVOUT prior to EXECing a program 
insures that it can read all of the DEVOUT file. DEVOUT should also be 
closed if DEVIN is to be used to read what was written to DEVOUT.


Format:
CLOSE fname

Input Parameter:
fname (word)  	DEVIN, DEVOUT, or filename

System Variables Set:
@ERROR (ivar)	Error Code:
	0 = No error
	1 = File not open


CLS
CLS  XE "CLS "  XE "viewports:clear " clears one or more viewports. Only 
the display is erased, without a change in entity data.

Format:
CLS [vpnum]

Input Parameter:
vpnum (ival)	Viewport number:
	-1 = All viewports
	0 or default = Primary viewport
	positive number = Designated viewport


System Variables Set:
@ERROR	0 = No error
	1 = Invalid viewport


CMOVE
CMOVE  XE "copious commands:move data pointer"  XE "CMOVE 
" moves the data "pointer" associated with the currently selected copious 
entity (see CREAD for an explanation of the "pointer" mechanism).


Format:
CMOVE mode, offset


Input Parameters:
mode (word)	Offset mode:
	abs = Absolute
	rel = Relative

offset (ival) 	Offset to move internal pointer. For absolute 
moves, offset ranges from 0 to the size of the 
entity minus one. For relative moves, a positive 
offset means a forward move, negative offset 
means a backward move.	
Output Parameters:
none


System Variables Set:
@ERROR (ivar) 	Error Code:
	0 = No error ("pointer" moved)
	1 = No currently selected entity
	2 = Offset out of range


CODE
CODE  XE "program control statements:CODE "  XE "CODE " declares 
the proper security code string to allow file execution to occur. If this 
statement exists in a CADL file, the security code string in the 
SECURE.DAT file must match the string in the CODE statement, or 
execution will not occur. Also, the code statement is invalid unless it is 
the first executable statement in the CADL file (LOCAL and REM 
statements are not executable).

This command is not required unless the default SECURE.DAT file 
supplied with the CADKEY installation diskettes has been changed. 
Refer to the Appendices section of the User Reference Guide for 
information on how to change the SECURE.DAT file to permit only 
properly coded CADL files to execute.


Format:
CODE "codestr"


CONIC
The CONIC  XE "primitives:CONIC "  XE "CONIC " primitive defines a 
conic section (i.e., ellipse, hyperbola, parabola) in a specified plane. The 
CONIC primitive is based on the following equation, which is the 
general quadratic representation of a conic:

		A*x2 + B*x*y + C*y2 + D*x + E*y + F = 0

When a CONIC primitive is read from a CADL file, a conic entity is 
created in the database.  If a CADL file includes a CONIC primitive with 
a reference to a VIEW primitive, that VIEW primitive must precede the 
CONIC primitive.


Format:
CONIC a, b, c, d, e, f, xs, ys, xe, ye, depth, [vnum], [col], [lev], [ltype], 
[grpnum], [subgrp], [pen], [lwdt]


Input Parameters:
a (double)  	Value of the coefficient A in the quadratic 
representation of the conic

b (double)	Value of the coefficient B in the quadratic 
representation of the conic

c (double) 	Value of the coefficient C in the quadratic 
representation of the conic

d (double) 	Value of the coefficient D in the quadratic 
representation of the conic
e (double)	Value of the coefficient E in the quadratic 
representation of the conic

f (double) 	Value of the coefficient F in the quadratic 
representation of the conic

xs (double) 	X coordinate for the start point of the conic in its view 
of definition

ys (double)	Y coordinate for the start point of the conic in its view 
of definition

xe (double)	X coordinate for the end point of the conic in its view 
of definition

ye (double) 	Y coordinate for the end point of the conic in its view 
of definition

depth (double) 	Depth of the conic in its view of definition

vnum (integer)	VIEW primitive reference number. The referenced 
VIEW primitive must precede the CONIC primitive or 
an error message is displayed and the program 
terminates.
	0 = Use current view number

col (integer) 	Color
	0-15 = Number in system color palette

lev (integer)	Level number
	1-256 = System level number
	0 = Use current system level number

ltype (integer) 	Line type:
	1 = Solid
	2 = Dashed
	3 = Center Line
	4 = Phantom Line
	0 = Use current system line type

grpnum (integer) 	Group reference number
	1-127 = Group number assigned
	0 = No group assignment

subgrp (integer)   	Subgroup reference number
	1-256 = Subgroup number assigned
	0 = No subgroup assignment

Note : If you wish to specify a group, you must include 
both the group and the subgroup number.  If either of 
these arguments is missing or set to zero(0), both of 
them will be ignored.

pen (integer) 	Pen number
	1-8 = Pen number
	0 = Use current system pen number

lwdt (integer)	Line width
	1-15 = Odd line width
	0 = Use current system line width


CREAD
CREAD  XE "copious commands:data input"  XE "CREAD " reads one or 
more values (items) sequentially from the currently selected copious 
entity and stores it in a specified variable. 

When a copious entity is selected, a "pointer" is set to the beginning of its 
data. Each time CREAD (or CWRITE) is used, the item(s) are read (or 
written) and the "pointer" is moved according to the size of the item and 
the number of items processed. This continues until the "pointer" reaches 
the end of the entity's data. At this point no more items can be processed 
unless the "pointer" is moved back via the CMOVE command. 

If CREAD is used to read more than one value, the variable must be an 
array large enough to contain the number of items requested. 

When specifying array variables, the inclusion of the indices is optional. 
For example, if an array is defined as xyz[3][3], specifying xyz[2][1] 
allows only that element to be set ("cnt" can only be 1). If xyz[1] is 
specified, elements xyz[1][0], xyz[1][1], and xyz[1][2] may be set in that 
order ("cnt" may be 1, 2, or 3). If only xyz is specified, the entire array (9 
elements) may be set, depending on the count.


Format:
CREAD item, var, [cnt]


Input Parameters:
item (word) 	Item to read:
	
	CHAR  	- Character
	INT 	-  Integer
	USHORT	-  Unsigned short
	LONG 	-  Long
	DOUBLE	-  Double
	TCODE	-  Copious entity type code
	ID 	-  Entity ID (copious or primitive)
	SIZE 	-  Copious entity size

cnt (ival)  	Count of items to read. If omitted, the count 
defaults to 1.


Output Parameter:
	var (var)  	Variable in which to store data


System Variables Set:
@ERROR (ivar)  	Error Code:
	0 = No error (data returned)
	1 = No currently selected entity
	2 = Not enough entity data to read
	3 = Variable not large enough for specified count


CWRITE
CWRITE  XE "copious commands:data output"  XE "CWRITE " writes 
one or more values (items) sequentially from a specified variable to the 
currently selected copious entity.

When a copious entity is selected, a "pointer" is set to the beginning of its 
data. Each time CWRITE is used, the item(s) are written and the 
"pointer" is moved according to the size of the item and the number of 
items processed. 

If more than one value is to be written, the variable must be an array 
large enough to contain the number of items requested. 

When specifying array variables, the inclusion of the indices is optional. 
For example, if an array is defined as xyz[3][3], specifying xyz[2][1] 
allows only that element to be written ("cnt" can only be 1). If xyz[1] is 
specified, elements xyz[1][0], xyz[1][1], and xyz[1][2] may be written in 
that order ("cnt" may be 1, 2, or 3). If only xyz is specified, the entire 
array (9 elements) may be written, depending on the count.


Format:
CWRITE item, var, [cnt]


Input Parameters:
item (word) 	Item to write:

	CHAR  	- Character
	INT 	-  Integer
	USHORT	-  Unsigned short
	LONG 	-  Long
	DOUBLE	-  Double
	TCODE	-  Copious entity type code
	ID 	-  Entity ID (copious or primitive)
	SIZE 	-  Copious entity size

var (var)  	Variable containing data to be written

cnt (ival) 	Count of items to write. If omitted, the count 
defaults to 1.


System Variables Set:
@ERROR (ivar)  	Error Code:
	0 = No error (data written)
	1 = No currently selected entity
	2 = Not enough room in entity to write data
	3 = Variable not large enough for specified count



DBLSCL
 XE "scaling:double"  XE "DBLSCL"  XE "viewports:double scale"  XE 
"viewports:zoom-in" DBLSCL performs a "zoom-in" on a part by 
doubling the current part scale factor. This performs the same function 
as using the system's Immediate Mode command, except that an 
automatic redraw is not performed. 


Format:
DBLSCL [vpnum]

Input Parameter:
vpnum (ival)	Viewport number:
	-1 = All viewports
	0 or default = Primary viewport
	positive number = Designated viewport



System Variables Set:
@ERROR	0 = No error		
	1 = Invalid viewport


DEFATTR
DEFATTR XE "entity control:attributes"  XE "DEFATTR" , in conjunction 
with SETATTR, allows for a number of entity attributes to be changed 
through CADL file execution. The purpose of DEFATTR is to define 
which attributes are to be set, as well as the order in which they are to 
appear. Once defined, SETATTR is called to actually modify an entity's 
attributes.


Format:
DEFATTR keywd1, [keywd2,...]


Input Parameters:
keywd1 = First attribute keyword

keywd2 = Second attribute keyword

The following attribute keywords are supported:


COLOR 	- Color
FCOLOR 	- Fill color
GRPNUM 	- Group number
LEVEL 	- Level number
LINETYPE 	- Line type
LINEWIDTH 	- Line width
PEN 	- Pen number
SUBGRP 	- Subgroup number
TEXTANG 	- Text rotation angle
TEXTASP 	- Text aspect ratio
TEXTFILL	- Text fill mode
TEXTFONT 	- Text font
TEXTHT 	- Text height
TEXTLINE 	- Text line spacing factor
TEXTMIR 	- Text mirror mode
TEXTSLANT 	- Text slant angle
TEXTULINE 	- Text underline mode


Note that if both the group number and the subgroup number are being 
set, GRPNUM must come before SUBGRP in the argument list otherwise 
the results are unpredictable.


Format:
DELCOP [id], [tcode1], ...


Input Parameters:
id (ival) 	ID of entity to delete.  If omitted, the currently 
selected entity is deleted (i.e., the one most 
recently selected by GETCOP).  If set to -1, all 
entities matching the specified type codes are 
deleted. Note that non-existent type codes are 
effectively ignored in that they will not match 
any entities.

tcode1 (ival) 	First entity type code for selection. As many as 
25 codes may be specified. If no codes are 
specified, all entity types are selected.


System Variables Set:
@ERROR (ivar)	Error Code:
	0 = No error
	1 = Matching ID not found or no currently 
selected entity


DELCTYPE
DELCTYPE  XE "copious commands:delete entity type"  XE "DELCTYPE 
" deletes a copious entity type. An entity type can be deleted only if no 
entities of that type exist.


Format:
DELCTYPE name


Input Parameter:
name (string)	Name of entity type to delete


System Variables Set:
@ERROR (ivar)	Error Code:
	0 = No error 
	1 = Type does not exist
	2 = Entities of specified type exist


DELENT
DELENT  XE "entity control:deleting"  XE "DELENT " deletes the last 
entity previously found by one of the get-entity commands (i.e., 
GETENT, GETNEXT, etc.). Alternatively, an ID can be supplied to delete 
a specific entity. If the ID is set to -1, all entities in the selection list are 
deleted.


Format:
DELENT [id]


Input Parameter: 
id (ival)	ID of entity to delete
	-1  = All entities in selection list


dg_add_binding
The dg_add_binding XE "dg_add_binding"  command is one of two 
methods for binding keyboard combinations to button and check box 
entities in a dialog box. After you bind one of these entities to a key, you 
can select the entity by pressing the specified key. Acceptable bindings 
are command keys F1 through F9 (specified by '1' through '9') and Alt-
A through Alt-Z (specified by 'A' through 'Z'.) These bindings will not 
conflict with Immediate Mode commands because Immediate Modes are 
disabled when a dialog box is running.


Format:
dg_add_binding  dhandle, index, key


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Button or check box entity to add binding to
key (integer)	Binding key


dg_add_box
The dg_add_box XE "dg_add_box"  command adds a box entity to the 
specified dialog box. To visually group related entities, you draw a box 
around them. The box is anchored by its upper-left corner and its width 
and height are specified by the number of columns and rows, 
respectively.


Format:
dg_add_box dhandle, index, row, col, numrows, numcols, $text, fcol, 
bcol, flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for this entity
row (double)	Row position
col (double)	Column position
numrows (double)	Height of the box
numcols (double)	Width of the box
$text (string)	Text to place in the upper left corner of the box
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_add_button
The dg_add_button XE "dg_add_button"  command adds a button 
entity to the specified dialog box. A button provides an option to allow 
you to make further choices or conclude the dialog. You can specify the 
size of the button (in number of characters) or you can specify that it 
automatically size itself to fit the text by giving the button a size of zero 
characters. In either case, add a space before and after the text to be 
located in the center of the button. The button default flag is 
DG_RET_ON_SEL(0x0001).

Format:
dg_add_button dhandle, index, row, col, numcols, $text, fcol, bcol, flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for this entity
row (double)	Row position
col (double)	Column position
numcols (integer)	Width, or 0 for auto size
$text (string)	Text for the button
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V) 


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_add_check
The dg_add_check XE "dg_add_check"  command adds a check box 
entity to the specified dialog box. A check box is used to provide an 
option that can be toggled. Clicking on a blank check box puts a cross in 
the box, indicating that it is selected. A selected check box is toggled back 
to an "un-checked" state by clicking on it again.


Format:
dg_add_check dhandle, index, row, col, checked, $text, fcol, bcol, flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for this entity
row (double)	Row position
col (double)	Column position
checked (integer)	Is box initially checked?
	0 = Box will not be checked
	1 = Box will be checked
$text (string)	Text string
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_add_combo
The dg_add_combo XE "dg_add_combo"  command adds a combo box 
entity to the specified dialog box. A combo box is a combination of a list 
of options like a list box and a text input field. An option can either be 
selected from the list in the combo box or it can be typed directly into the 
input field. Normally, only the input field is displayed in the dialog box.  
However, the list of options can be  displayed by clicking on the down-
arrow icon. If the 'me' (Must Exist) argument is specified as TRUE, the 
selection must either be made from the list in combo box, or the string 
typed in the input field will be forced to match one of the strings in the 
list. The text for the list of options does not have to be provided at the 
time the combo box is added to the dialog box. Instead, an slist of null 
strings ("") can be provided for the text. In this case, the list can be added 
later by using the dg_set_combo_list_text command. 


Format:
dg_add_combo dhandle, index, row, col, numrows, colwidth, mustexist, 
$value, num, $$text, fcol, bcol, flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for this entity
row (double)	Row position
col (double)	Column position
numrows (integer)	Number of rows in the list box
colwidth (integer)	Column width of the list box
mustexist (integer)	Must exist flag:
	0 = Choice doesn't have to exist in list
	1 = Choice must exist in list
$value (string)	Initial value for input field
num (integer)	Total number of strings in list box
$$text (slist)	Array of string choices
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_add_icon
The dg_add_icon XE "dg_add_icon"  command adds an icon entity to 
the specified dialog box. An icon is similar to a button, but contains line 
graphics instead of text. The width and height of the icon and its 
graphics are defined in an external text file. The name of the icon and 
the text file it is contained in are required as arguments for this 
command.

If the icon filename includes no path, then the file must reside in the 
support directory.  If a path is to be included, the filename is handled as 
a format string, which means if you wish to use backslashes, you must 
use '\\' (i.e., $fname = "c:\\cadkey\\icons\\myicon").  The file 
extension for an icon file is assumed to be .cdi.  


Format:
dg_add_icon  dhandle, index, row, col, outline, $name, $fname, flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index  (integer)	Unique index for this entity
row (double)	Row position
col (double)	Column position
outline (integer)	Flag for icon outline:
	0 = Do not draw the outline
	1 = Draw the outline
$name (string)	The name of the icon
$fname (string)	File where icon resides
flags (integer)	Entity attributes (see Appendix V)


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_add_list
The dg_add_list XE "dg_add_list"  command adds a list box entity to the 
specified dialog box. A list box allows the selection of one string from a 
large set of strings. The available strings are displayed in a box that can 
be paged up and down using  icons. The text for the list of strings does 
not have to be provided at the time the list box is added to the dialog 
box. Instead, an slist of null strings ("") can be provided for the text. In 
this case, the list can be added later by using the dg_set_list_text 
command.


Format:
dg_add_list dhandle, index, row, col, numrows, colwidth, num, $$text, 
fcol, bcol, flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for this entity
row (double)	Row position
col (double)	Column position
numrows (integer)	Number of rows displayed per page
colwidth (integer)	Width of each column
num (integer)	Total number of strings
$$text (slist)	Array of text choices
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.



dg_add_note
The dg_add_note XE "dg_add_note"  command adds a note entity to the 
specified dialog box. A note entity is a string of text in the dialog box.


Format:
dg_add_note dhandle, index, row, col, $text, fcol, bcol, flags
Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for this entity
row (double)	Row position
col (double)	Column position
$text (string)	The note to be displayed
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_add_radio
The dg_add_radio command  XE "dg_add_radio" adds a radio button 
entity to the specified dialog box. Radio buttons give a group of options 
from which only one option can be selected at a time. If the user picks a 
new option from the set, the previously selected option is de-selected. 
The text for the options does not have to be provided at the time the 
radio buttons are added to the dialog box. Instead, an slist of null strings 
can be provided for the text. In this case, the list can be added later by 
using the dg_set_radio_text command.


Format:
dg_add_radio dhandle, index, row, col, picked, num, $$text, fcol, bcol, 
flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for this entity
row (double)	Row position
col (double)	Column position
picked (integer)	Radio button which is initially picked
num (integer)	Total number of radio buttons
$$text (slist)	Array of text choices
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)

System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_add_slider
The dg_add_slider XE "dg_add_slider"  command adds a slider entity to 
the specified dialog box. A slider entity is a scroll bar with a draggable 
slider bar in the middle of the entity and direction icons on either end. 
Pressing the icons moves the slider by a user-specified increment in that 
direction. Clicking in the area between an icon and the slider bar causes 
the slider to move a specified number of segments. The slider bar itself 
can be dragged by holding the mouse button down.


Format:
dg_add_slider dhandle, index, row, col, numsegs, pageinc, length, vert, 
fcol, bcol, flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for this entity
row (double)	Row position
col (double)	Column position
numsegs (integer)	Total number of segments in the slider
pageinc (integer)	Number of segments to move on a page hit
length (integer)	Length of the slider (not including the ICONS)
vert (integer)	Direction of slider:
	0 = Horizontal
	1 = Vertical
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.
dg_add_table
The dg_add_table XE "dg_add_table"  command adds a table entity to 
the specified dialog box. A table is made of columns. Columns can have 
different widths, different input types (double, integer or string), 
different format strings, and different titles. The initial values for the 
columns are set later on using the dg_set_table command. The number 
of rows in the table is specified in the arguments. If this maximum 
number is set to 0, rows can be added to the table by using the 
dg_add_table_row command.

Format:
dg_add_table dhandle, index, row, col, numrows, numcols, colwidth, 
$$ch, maxrows, fcol, bcol, flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for this entity
row (double)	Row position
col (double)	Column position
numrows (integer)	Number of rows in the table
numcols (integer)	Number of columns in the table
colwidth[] (iarray) 	Array of column widths
$$ch (slist)	Array of column headers
maxrows(integer)	Total number of rows in the table
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.



dg_add_table_row
The dg_add_table_row XE "dg_add_table_row"  command adds a row 
to an existing table. The new row is added to the bottom of the table. All 
string columns in this row are set to blank, and the integer and double 
columns are set to zero.

Format:
dg_add_table_row dhandle, index, row


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	The table to add to 
row (integer)	The row to add;  must be the last


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_add_text_double
The dg_add_text_double XE "dg_add_text_double"  command adds an 
input field for double precision values to the specified dialog box. The 
field is initialized to the value provided in the arguments, which is 
displayed using the specified format string. The value typed by the user 
is processed by the calculator, and the computed value is placed in the 
field.


Format:
dg_add_text_double dhandle, index, row, col, maxwidth, $fmt, value, 
fcol, bcol, flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for this entity
row (double)	Row position
col (double)	Column position
maxwidth (integer)	Maximum width
$fmt(string)	The printf string used for display
value (double)	Starting value for the field
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)

System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.

dg_add_text_int
The dg_add_text_int XE "dg_add_text_int"  command adds an input 
field for integer values to the specified dialog box. The field is initialized 
to the value provided in the arguments, which is displayed using the 
specified format string.  The value typed by the user is processed by the 
calculator, and the computed value is placed in the field.


Format:
dg_add_text_int  dhandle, index, row, col, maxwidth, $fmt, value, fcol, 
bcol, flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for this entity
row (double)	Row position
col (double)	Column position
maxwidth (integer)	Maximum width
$fmt (string)	The printf string used for display
value (integer)	Starting value for the field
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)

System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_add_text_string
The dg_add_text_string XE "dg_add_text_string"  command adds an 
input field for character string values to the specified dialog box. The 
field is initialized to the value provided in the arguments, which is 
displayed using the specified format string.


Format:
dg_add_text_string dhandle, index, row, col, maxwidth, $fmt, $value, 
fcol, bcol, flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for this entity
row (double)	Row position
col (double)	Column position
maxwidth (integer)	Maximum width
$fmt (string)	The printf string used for display
$value (string)	Starting string for the field
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)

System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_add_title
After an entity has been created, it can be given a title using 
dg_add_title XE "dg_add_title" . The positioning for the title is specified 
relative to the entity's anchor point.


Format:
dg_add_title dhandle, index, row, col, $text, fcol, bcol


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Entity to which to add title
row (double)	Row delta (relative to entity's anchor point)
col (double)	Column delta (relative to entity's anchor point)
$text (string)	Text of the title
fcol (integer)	Foreground color
bcol (integer)	Background color

System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_child_dialog
A dialog box can be defined as a child of an existing dialog box using 
dg_child_dialog xe "dg_child_dialog" . The following are the only 
restrictions that apply to a child dialog box:

o	It can be displayed only if its parent dialog box is currently being 
displayed.
o	It must be displayed completely inside the parent dialog box.
o	The anchor point for the dialog box must be specified relative to 
the top left corner of the parent dialog box.

When a child dialog box is running, only the entities in the child dialog 
box are active, although the entities in the parent dialog box may still be 
visible.

Format:
dg_child_dialog dhandle, rows, cols, srow, scol, items, $title, fcol, bcol, 
flags


Input Parameters:
dhandle (long)	The parent dialog box handle (refer to 
dg_init_dialog)
rows (integer)	Rows in the dialog box
cols (integer)	Columns in the dialog box
srow (double)	Row offset location in parent
scol (double)	Column offset location in parent
items (integer)	Total number of entities in the dialog box
$title (string)	Text to place in the title bar
fcol (integer)	Foreground color for the dialog box
bcol (integer)	Background color for the dialog box
flags (integer)	Global flags for the dialog box

System Variables Set:
@ERROR 	Handle for the child dialog box , usually referred 
to as 'dhandle' in the rest of the calls


dg_del_combo_list_text
The dg_del_combo_list_text XE "dg_del_combo_list_text"  command 
removes a string from the list of options in a combo box. The string to be 
removed is specified by its number in the list.

Format:
dg_del_combo_list_text  dhandle, index, num


Input Parameters:
dhandle (long)	The handle of the dialog box to delete(refer to 
dg_init_dialog)
index (integer)	Combo box's index
num (integer)	Number of string to remove


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_del_ent
The dg_del_ent XE "dg_del_ent"  command removes an entity from a 
dialog box. Once an entity is removed, its index number can be reused 
for a new entity in that dialog box.
Format:
dg_del_ent dhandle, index


Input Parameters:
dhandle (long)	Dialog box to delete entity from (refer to 
dg_init_dialog)
index (integer)	Index of entity to delete


dg_del_list_text
The dg_del_list_text XE "dg_del_list_text"  command removes a string 
from the list of options in a list box. The string to be removed is specified 
by its number in the list.

Format:
dg_del_list_text dhandle, index, num


Input Parameters:
dhandle (long)	Dialog box to delete from (refer to 
dg_init_dialog)
index (integer)	Index of list box
num (integer)	Number of string to delete


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_del_table_row
The dg_del_table_row XE "dg_del_table_row"  command deletes a row 
from a table. The row to be deleted is specified by its number.

Format:
dg_del_table_row dhandle, index, row


Input Parameters:
dhandle (long)	Dialog box to delete from (refer to 
dg_init_dialog)
index (integer)	Index of table
row (integer)	Row to delete


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_draw_dialog
The dg_draw_dialog XE "dg_draw_dialog"  command draws the dialog 
box on the screen. If there are multiple viewports on the screen, the 
dialog box overlaps the viewports. The dg_draw_dialog command is 
also used to "un-freeze" a dialog box which is currently displayed on the 
screen.


Format:
dg_draw_dialog  dhandle

Input Parameter:
dhandle (long)	Dialog box to draw (refer to dg_init_dialog)

System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_erase_dialog
After the dialog box interaction is finished, it can be erased using the 
dg_erase_dialog xe "dg_erase_dialog"  command. This command does 
not affect the contents of the dialog box, but merely removes the dialog 
box from the screen, restoring the graphics viewports.

Format:
dg_erase_dialog dhandle


Input Parameter:
dhandle (long)	Dialog box to erase (refer to dg_init_dialog)


dg_free_dialog
If a dialog box is not needed anymore, it can be deleted using 
dg_free_dialog XE "dg_free_dialog" . This will free all memory 
associated with the dialog box and release the dialog box handle.


Format:
dg_free_dialog dhandle


Input Parameter:
dhandle (long)	Dialog box to destroy (refer to dg_init_dialog)


dg_freeze_dialog
The dg_freeze_dialog XE "dg_freeze_dialog"  command freezes a dialog 
box when a large number of changes are to be made in a dialog box 
while it is being displayed. When a dialog box is frozen, the user cannot 
update any fields in the dialog box. This prevents the user from selecting 
an obsolete option. Once the changes to the dialog box are done, it can be 
reactivated using the dg_draw_dialog command.

Format:
dg_freeze_dialog dhandle


Input Parameter:
dhandle (long)	Dialog box to freeze (refer to dg_init_dialog)


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_get_box_rc
The dg_get_box_rc XE "dg_get_box_rc"  command returns the row and 
column of the last cursor pick inside a box entity relative to the specified 
dialog box. 

Format:
dg_get_box_rc dhandle, index, row, col


Input Parameters:
dhandle (long)	The dialog box you wish to check (refer to 
dg_init_dialog)
index (integer)	Unique index for the box entity


Output Parameters:
row (double)	Row position of the last cursor pick inside a box 
entity
col (double)	Column position of the last cursor pick inside a 
box entity


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_get_cell_double
The dg_get_cell_double XE "dg_get_cell_double"  command returns the 
double precision value from a specified cell in a table. The cell is 
specified by its row and column.


Format:
dg_get_cell_double dhandle, index, row, col


Input Parameters:
dhandle (long)	Dialog box that holds the table (refer to 
dg_init_dialog)
index (integer)	Index of the table
row (integer)	Row of cell
col (integer)	Column of cell


System Variables Set:
@ERROR	The double precision value from the specified 
table cell
dg_get_cell_int
The dg_get_cell_int XE "dg_get_cell_int"  command returns the integer 
value from a specified cell in a table. The cell is specified using its row 
and column.
Format:
dg_get_cell_int dhandle, index, row, col


Input Parameters:
dhandle (long)	Dialog box that holds the table (refer to 
dg_init_dialog)
index (integer)	Index of the table
row (integer)	Row of cell
col (integer)	Column of cell


System Variables Set:
@ERROR	The integer value from the specified cell


dg_get_cell_string
The dg_get_cell_string XE "dg_get_cell_string"  command returns the 
character string from a specified cell in a table. The cell is specified using 
its row and column.

Format:
dg_get_cell_string dhandle, index, row, col


Input Parameters:
dhandle (long)	Dialog box that holds the table (refer to 
dg_init_dialog)
index (integer)	Index of the table
row (integer)	Row of cell
col (integer)	Column of cell


System Variables Set:
@STRDAT	The character string from the specified cell
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_get_check
The dg_get_check XE "dg_get_check"  command returns the status of 
the specified check box. If the box is checked, a one (1) is returned. 
Otherwise the command returns a zero (0).

Format:
dg_get_check dhandle, index


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Index of the check box


System Variables Set:
@ERROR	Returned status of check box:
	0 = Check box is not checked
	1 = Check box is checked


dg_get_colors
The dg_get_colors XE "dg_get_colors"  command is used to get the color 
table used for various purposes in a dialog box. There are 11 colored 
items such as foregrounds and backgrounds of a dialog box, list, text, 
slider etc. In order to set the color table also refer to dg_set_colors 
command.

Format:
dg_get_colors color

Output Parameter:
color[] (integer)	The array of integers containing color codes

The possible colors are between 0-15:

0 = BLACK	8 = BLUE
1 = GREEN	9 = LIGHT BLUE
2 = RED	        10 = LIGHT GREEN
3 = BROWN	11 = LIGHT CYAN
4 = YELLOW	12 = LIGHT  RED
5 = CYAN	13 = LIGHT MAGENTA
6 = MAGENTA	14 = LIGHT GREY
7 = GREY	15 = WHITE

The default values in the color table are as follows:

color[0]     	8	Dialog box background, title foreground
color[1]     	15	Dialog box foreground, border color and title 
background
color[2]     	2	Color #1 for Alert boxes
color[3]     	15	Color #2 for Alert  boxes
color[4]     	15	List, text and table background
color[5]     	0	List, text and table foreground
color[6]     	0	Color #1 for the selected item
color[7]     	15	Color #2 for the selected item
color[8]     	14	Inactive entity
color[9]   	7	Slider background
color[10]   	1	Slider foreground
color[11]     	0 	Reserved for future use


dg_get_combo_list_active
The dg_get_combo_list_active XE "dg_get_combo_list_active"  
command returns the list index number of the currently selected string 
in the combo box.


Format:
dg_get_combo_list_active dhandle, index


Input Parameters:
dhandle (long)	Dialog box  handle (refer to dg_init_dialog)
index (integer)	Combo box index

System Variables Set:
@ERROR	List index of the active element of the specified 
combo box


dg_get_combo_string
The dg_get_combo_string XE "dg_get_combo_string"  command 
returns the specified character string value of the text input portion of a 
combo box.

Format:
dg_get_combo_string dhandle, index


Input Parameters:
dhandle (long)	Dialog box that holds the combo box (refer to 
dg_init_dialog)
index (integer)	Combo box index

System Variables Set:
@STRDAT	The character string displayed in the combo box


dg_get_flags
The dg_get_flags XE "dg_get_flags"  command returns the flags 
associated with an entity. The entity is specified by its index number in 
the dialog box. See Appendix V for the list of flags that can be attached 
to an entity.


Format:
dg_get_flags dhandle, index


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Queried entity's index


System Variables Set:
@ERROR	Flags associated with the specified entity. See 
Appendix V.


dg_get_icon_rc
The dg_get_icon_rc XE "dg_get_icon_rc"  command returns the row and 
column of last cursor pick inside an icon to the specified dialog box. 

Format:
dg_get_icon_rc dhandle, index, row, col


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for the icon entity


Output Parameters:
row (double)	Row position of the last cursor pick inside an 
icon
col (double)	Column position of the last cursor pick inside an 
icon


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_get_list
The dg_get_list XE "dg_get_list"  command returns the list index 
number of the currently selected string in the list box.


Format:
dg_get_list dhandle, index


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	List box index


System Variables Set:
@ERROR	Selected string's index in the list box


dg_get_list_text
The dg_get_list_text XE "dg_get_list_text"  command returns the 
specified character string from a list box. The string is specified by its 
index number in the list.

Format:
dg_get_list_text dhandle, index, num


Input Parameters:
dhandle (long)	Dialog box that holds the table (refer to 
dg_init_dialog)
index (integer)	List box index
num (integer)	String's list index to retrieve

System Variables Set:
@STRDAT	Character string of specified index in the list box


dg_get_note
The dg_get_note XE "dg_get_note"  command returns the text of a 
specified note entity.


Format:
dg_get_note dhandle, index
Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Index of the note entity

System Variables Set:
@STRDAT	The character string stored in the note


dg_get_radio
The dg_get_radio XE "dg_get_radio"  command returns the index 
number of the currently selected button from the specified radio button 
set.


Format:
dg_get_radio dhandle, index


Input Parameters:
dhandle (long)	Dialog box  handle (refer to dg_init_dialog)
index (integer)	Radio button set's index


System Variables Set:
@ERROR	The number of the radio button selected


dg_get_slider
The dg_get_slider XE "dg_get_slider"  command returns the segment 
number where the slider bar is in the specified slider.
Format:
dg_get_slider dhandle, index


Input Parameters:
dhandle (long)	Dialog box  handle (refer to dg_init_dialog)
index (integer)	Slider's index


System Variables Set:
@ERROR	Segment number where bar is located


dg_get_table_changed
The dg_get_table_changed XE "dg_get_table_changed"  command 
returns the row and column number of the last cell in the table whose 
value was modified by the user. If no cell in the table was modified, the 
command returns a -1 for row and column numbers.


Format:
dg_get_table_changed dhandle, index, row, col


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Table's index


Output Parameters:
row (integer)	Row number of last cell changed
col (integer)	Column number of last cell changed


dg_get_table_invert_status
The dg_get_table_invert_status XE "dg_get_table_invert_status"  
command tells a user whether the specified row in the table is inverted 
(highlighted) or not. If the command returns TRUE, the row is inverted; 
otherwise it is in its normal state.

Format:
dg_get_table_invert_status dhandle, index, row


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Table's index
row (integer)	Row to inquire


System Variables Set:
@ERROR	Status of row:
	0 = The row is not inverted
	1 = The row is inverted


dg_get_text_double
The dg_get_text_double XE "dg_get_text_double"  command returns 
the double precision value in an input field. The input field is specified 
by its index number in the dialog box.

Format:
dg_get_text_double dhandle, index


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Input field's index


System Variables Set:
@ERROR	The double precision value stored in the input 
field


dg_get_text_int
The dg_get_text_int XE "dg_get_text_int"  command returns the integer 
value in an input field. The input field is specified by its index number in 
the dialog box.

Format:
dg_get_text_int dhandle, index


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Input field's index



System Variables Set:
@ERROR	The integer value stored in the input field


dg_get_text_string
The dg_get_text_string XE "dg_get_text_string"  command returns the 
character string in an input field. The input field is specified by its index 
number in the dialog box.


Format:
dg_get_text_string dhandle, index


Input Parameters:
dhandle (long)	Dialog box that holds the input field (refer to 
dg_init_dialog)
index (integer)	Input field's index

System Variables Set:
@STRDAT	The character string stored in the input field


dg_init_dialog
The dg_init_dialog XE "dg_init_dialog"  command creates a dialog box 
and allocates memory for the dialog box. The total number of entities in 
the dialog box has to be specified at the time the dialog box is created. In 
addition, the width and height of the dialog box (in columns and rows, 
respectively), its title, and the placement option are also required. The 
command returns the handle of this dialog box that has to be used for all 
subsequent action related to this dialog box. If for some reason the dialog 
box cannot be created, the command returns a 0.


Format:
dg_init_dialog rows, cols, items, $title, fcol, bcol, plac_opt, flags


Input Parameters:
rows (integer)	Rows in the dialog box
cols (integer)	Columns in the dialog box
items (integer)	Total number of entities in the dialog box
$title (string)	Text to place in the title bar
fcol (integer)	Foreground color for the dialog box
bcol (integer)	Background color for the dialog box
plac_opt (integer)	Placement option:
	0 = Top left
	1 = Top right
	2 = Bottom left
	3 = Bottom right
	4 = Center of graphics area
flags (integer)	Global flags for the dialog box


System Variables Set:
@ERROR 	Handle for the dialog box , usually referred to as 
'dhandle' in the rest of the calls
dg_inq_dialog_wh
The dg_inq_dialog_wh XE "dg_inq_dialog_wh"  command can be used 
to inquire the width and height of a dialog box. When a dialog box 
handle is supplied, the command returns the width and height of the 
dialog box.

Format:
dg_inq_dialog_wh dhandle, width, height


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)


Output Parameters:
width (integer)	Width of the dialog box
height (integer)	Height of the dialog box


dg_invert_table_row
The dg_invert_table_row command  XE "dg_invert_table_row 
" highlights a specified row in a table by swapping the foreground and 
background colors. Using this command on an already highlighted row 
brings the row back to normal.


Format:
dg_invert_table_row dhandle, index, row


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Table's index
row (integer)	Row to invert


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_lock_table_col
The dg_lock_table_col XE "dg_lock_table_col"  command locks the 
specified column in a table. This prevents the user from making any 
changes to the values in that column.

Format:
dg_lock_table_col dhandle, index, col


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Table's index
col (integer)	Column to lock


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_move_focus
In a dialog box, some entity always has the focus. Any keyboard input by 
the user is directed to that entity. The user can change the focus by using 
mouse picks, tab keys, etc. The dg_move_focus XE "dg_move_focus"  
command performs the same task without user interaction. If the user 
makes a selection that should be followed by interaction with another 
option in the dialog box, use the dg_move_focus command to change the 
focus to this next option. This command can be used before the dialog 
box is run to start the dialog box with a particular entity as the focus.

Format:
dg_move_focus dhandle, index


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Index of entity to move focus to 


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_radio_align
The dg_radio_align xe "dg_radio_align"  command realigns the radio 
buttons to conform to the coordinates supplied in the 'relrow[]' and 
'relcol[]' arrays.  The first radio button in the set is repositioned at 
coordinates (relrow[0], relcol[0]), the second button at (relrow[1], 
relcol[1]), etc.  

Format:
dg_radio_align dhandle, index, relrow, relcol


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Unique index for this entity
relrow[] (double)	Array of new row position(s) relative to the 
original radio button anchor point within the 
dialog box (row parameter in dg_add_radio 
command).  
relcol[] (double)	Array of new column position(s) relative to the 
original radio button anchor point within the 
dialog box (col parameter in dg_add_radio 
command)


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_run_dialog
After a dialog box has been displayed on the screen, it is activated for 
user interaction with the dg_run_dialog XE "dg_run_dialog"  command. 
This command returns the index of the button pressed by the user. If 
another entity had the DG_RET_ON_SEL flag associated with it, its 
selection will also terminate the running of the dialog box, returning the 
index of that entity. Note that a dialog box is not erased from the screen 
after it has stopped running. 

Format:
dg_run_dialog dhandle


Input Parameter:
dhandle (long)	The handle of dialog box to run (refer to 
dg_init_dialog)


System Variables Set:
@ERROR	The index of the button pressed
dg_set_button_border
The dg_set_button_border XE "dg_set_button_border"  command is used 
to set the number of pixels to be used for all button borders.

Format:
dg_set_button_border  pixels


Input Parameter:
pixels (integer)	Number of pixels to be used to represent width 
of button borders (pixels >= 0). The default value 
is 2.


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_set_cell_double
The dg_set_cell_double XE "dg_set_cell_double"  command is used to 
set the double precision value of a cell in a table to the specified value. 
The cell is specified by its row and column number in the table.

Format:
dg_set_cell_double dhandle, index, row, col, val


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Table's index
row (integer)	Row number of cell to modify
col (integer)	Column number of cell to modify
val (double)	Cell's new value 


dg_set_cell_int
The dg_set_cell_int XE "dg_set_cell_int"  command is used to set the 
integer value of a cell in a table to the specified value. The cell is 
specified by its row and column number in the table.

Format:
dg_set_cell_int dhandle, index, row, col, val


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Table's index
row (integer)	Row number of cell to modify
col (integer)	Column number of cell to modify
val  (integer)	Cell's new value 


dg_set_cell_string
The dg_set_cell_string XE "dg_set_cell_string"  command is used to set 
the character string of a cell in a table to the specified string. The cell is 
specified by its row and column number in the table.

Format:
dg_set_cell_string dhandle, index, row, col, $val


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Table's index
row (integer)	Row number of cell to modify
col (integer)	Column number of cell to modify
$val (string)	Cell's new value 

dg_set_check
The dg_set_check XE "dg_set_check"  command is used to change the 
state of a check box. If the checked flag is 1, the box is checked. If it is 0, 
the box is not checked.


Format:
dg_set_check dhandle, index, checked


Input Parameters:
dhandle (long)	Handle for dialog box containing the check box 
(refer to dg_init_dialog)
index (integer)	Check box's index
checked (integer)	Flag to set the check  box:
	0 = Check box is not checked
	1 = Check box is checked

System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_set_colors
The dg_set_colors XE "dg_set_colors"  command is used to set the colors 
used for various purposes in a dialog box. There are 11 colored items, 
such as foregrounds and backgrounds of a dialog box, list, text, slider, 
etc.  In order to get the color table also refer to the dg_get_colors 
command.

Format:
dg_set_colors color


Input Parameter:
color[] (integer)	The array of integers containing color codes

The possible colors are between 0-15:

0 = BLACK	8 = BLUE
1 = GREEN	9 = LIGHT BLUE
2 = RED	        10 = LIGHT GREEN
3 = BROWN	11 = LIGHT CYAN
4 = YELLOW	12 = LIGHT  RED
5 = CYAN	13 = LIGHT MAGENTA
6 = MAGENTA	14 = LIGHT GREY
7 = GREY	15 = WHITE

The default value of the color table is as follows:

color[0]     	8	Dialog box background, title foreground
color[1]     	15	Dialog box foreground, border color and title 
background
color[2]     	2	Color #1 for Alert boxes
color[3]     	15	Color #2 for Alert  boxes
color[4]     	15	List, text and table background
color[5]     	0	List, text and table foreground
color[6]     	0	Color #1 for the selected item
color[7]     	15	Color #2 for the selected item
color[8]     	14	Inactive entity
color[9]   	7	Slider background
color[10]   	1	Slider foreground
color[11]     	0 	Reserved for future use


dg_set_combo_list_active
The dg_set_combo_list_active XE "dg_set_combo_list_active"  
command is used to change the current selection in the combo box to the 
specified string in the list. Also, this changes the string in the input field 
of the combo box to that string.

Format:
dg_set_combo_list_active dhandle, index, active


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Combo list's index 
active (integer)	Number of list element to set active


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_set_combo_list_text
The dg_set_combo_list_text XE "dg_set_combo_list_text"  command 
changes the text of a particular string in the combo box list. The string to 
be changed is specified by its list index number. If the index number 
specified is greater than the total number of strings in the list, the list 
expands to that size. This provides the mechanism to grow a combo box 
list from within the program.

Format:
dg_set_combo_list_text dhandle, index, num, $text


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Combo list index 
num (integer)	Number of list element being added
$text (string)	List elements' text 


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.
dg_set_combo_string
The dg_set_combo_string XE "dg_set_combo_string"  command sets the 
string displayed in the input field of the combo box. This string does not 
have to be from the combo box list.

Format:
dg_set_combo_string dhandle, index, $val


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Combo box index
$val (string)	Combo box character string


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_set_flags
The dg_set_flags XE "dg_set_flags"  command allows the flags 
associated with an entity to be changed after it has been added to a 
dialog box. If the "on" argument is supplied as TRUE, the flags provided 
with the dg_set_flags command will be attached to the specified entity. 
If the "on" argument is supplied as FALSE, the flags will be removed 
from the entity.

Format:
dg_set_flags dhandle, index, flags, on


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Entity index
flags (integer)	Entity flags
on (integer)	Flag switch:
	0 = Turn flags off
	1 = Turn flags on

System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_set_list
The dg_set_list XE "dg_set_list"  command is used to change the current 
selection in a list box. The new string is specified by its list index number.
Format:
dg_set_list dhandle, index, active


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	List box index 
active (integer)	List element to set active


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_set_list_text
The dg_set_list_text XE "dg_set_list_text"  command changes the text of 
a particular string in the list box. The string to be changed is specified by 
its list index number. If the index number specified is greater than the 
total number of strings in the list, the list expands to that size. This 
provides the mechanism to grow a list box from within the program.


Format:
dg_set_list_text  dhandle, index, num, $text


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	List box index 
num (integer)	Number of list element being modified
$text (string)	New character string for the list element


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_set_note
The dg_set_note XE "dg_set_note"  command sets the string displayed in 
the note entity field of the dialog box. 

Format:
dg_set_note dhandle, index, $text


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Note entity index
$text (string)	Text string

System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_set_radio
The dg_set_radio XE "dg_set_radio"  command is used to change the 
current selection in a set of radio buttons. The button to pick is specified 
by its number in the set.


Format:
dg_set_radio dhandle, index, picked


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Index of radio button set
picked (integer)	Radio button's number to pick

System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_set_radio_text
The dg_set_radio_text XE "dg_set_radio_text"  command is used to 
change the text associated with a radio button in a set of radio buttons. 
The radio button to modify is specified by its number in the set.


Format:
dg_set_radio_text dhandle, index, button, $text


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Index of radio button set
button (integer)	Button number to modify text
$text (string)	New text for radio button


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_set_slider
The dg_set_slider XE "dg_set_slider"  command is used to set the 
various parameters of a slider. It can change the position of the slider 
bar in a slider to a specified segment, the total number of segments in the 
slider or the page increment of the slider in terms of the number of 
segments. These parameters can all be changed simultaneously. If only 
some of the parameters are being changed,  a -1 can be provided for 
other parameters to keep them at their original value.
Format:
dg_set_slider dhandle, index, seg, numsegs, pageinc


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Slider index 
seg (integer)	New segment for slider bar
	-1 = No change
numsegs (integer)	Number of segments
	-1 = No change
pageinc (integer)	New paging increment
	-1 = No change


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_set_table_doubles
The dg_set_table_doubles XE "dg_set_table_doubles"  command sets 
the double precision values of a column in a table. The values are 
displayed using the format string supplied. There must be enough values 
provided to fill all the rows in that column. 


Format:
dg_set_table_doubles dhandle, index, col, $fmt, vals, fcol, bcol, flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Table to set
col (integer)	Column to set
$fmt (string)	Printf format string to use
vals[] (array)	Array of initial values  
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)




dg_set_table_ints
The dg_set_table_ints XE "dg_set_table_ints"  command lets you set the 
integer values of a column in a table. The values are displayed using the 
format string supplied. There must be enough values provided to fill all 
the rows in that column. 

Format:
dg_set_table_ints dhandle, index, col, $fmt, vals, fcol, bcol, flags


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Table to set
col (integer)	Column to set
$fmt (string)	Printf format string to use
vals[] (iarray)	Array of initial values  
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)


dg_set_table_strings
The dg_set_table_strings XE "dg_set_table_strings"  command lets you 
set the character strings of a column in a table. The strings are displayed 
using the format string supplied. There must be enough strings provided 
to fill all the rows in that column. 

Format:
dg_set_table_strings dhandle, index, col, $fmt, $$text, fcol, bcol, flags


Input Parameters:
dhandle (long)	Dialog box to add to (refer to dg_init_dialog)
index (integer)	Table to set
col (integer)	Column to set
$fmt (string)	Printf format string to use
$$text (slist)	Initial strings
fcol (integer)	Foreground color
bcol (integer)	Background color
flags (integer)	Entity attributes (see Appendix V)


dg_set_text_double
The dg_set_text_double XE "dg_set_text_double"  command is used to 
set the double precision value of an input field. 

Format:
dg_set_text_double dhandle, index, val


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Input field index 
val (double)	New value

System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_set_text_int
The dg_set_text_int XE "dg_set_text_int"  command is used to set the 
integer value of an input field. 

Format:
dg_set_text_int dhandle, index, val


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Input field index 
val (integer)	New value

System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.
	

dg_set_text_string
The dg_set_text_string XE "dg_set_text_string"  command is used to set 
the character string of an input field. 


Format:
dg_set_text_string dhandle, index, $val


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
index (integer)	Input field index 
$val (string)	New value


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_set_title
The dg_set_title XE "dg_set_title"  command sets the string displayed as 
a title of the dialog box. 

Format:
dg_set_title dhandle, $text


Input Parameters:
dhandle (long)	Dialog box handle (refer to dg_init_dialog)
$text (string)	Title string

System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


dg_unlock_table_col
The dg_unlock_table_col XE "dg_unlock_table_col"  command is used to 
unlock a table column. Once a column has been unlocked, the contents of 
its cells can be modified by the user.

Format:
dg_unlock_table_col dhandle, index, col


Input Parameters:
dhandle (long)	Dialog box containing the table (refer to 
dg_init_dialog)
index (integer)	Table's index
col (integer)	Column to unlock


System Variables Set:
@ERROR	Error message:
	0 = No error
	See Appendix IV for a list of errors.


DOSUB
DOSUB  XE "program control statements:DOSUB "  XE "DOSUB 
" transfers control to another CADL file. However, once the end of file is 
reached or an EXIT command is processed (within the file to which 
control has been transferred), control returns to the current file and 
execution continues at the statement following the DOSUB. Up to four 
nested levels of DOSUBs are permitted. 


Format:
DOSUB fname 


Input Parameter:
fname (word)	CADL file you wish to transfer control to

 
File Specification:
The file specification is processed as follows: 

1) 	If a full path is included, the specified directory is used.

2)	If the specification includes a relative path, the specified directory is 
relative to the directory of the initial CADL program; except if the 
relative path begins with either "." or "..". In this case, the specified 
directory is relative to the same directory as the CADL program 
containing the DOSUB command. 

3)	If no path is specified, the directory is assumed to be the same as the 
initial CADL program (i.e., the program run from the CADKEY 
menus).


The ".cdl" file extension is always forced. 

When specifying a path, the use of forward slashes (/) or backslashes (\)  
is dependent upon the operating system under which CADKEY is 
running. 

In the event of an error (namely, the specified file does not exist), 
execution from within the current CADL file is terminated. 
 

DRAWENT
DRAWENT  XE "entity control:drawing"  XE "DRAWENT " draws the 
specified entity if displayable. 

To be displayable, the entity must be: 	

	1) at least partially within the current viewport bounds; 
	2) in the current view (if applicable); and 
	3) on a displayed level.


Format:
DRAWENT [id], [erase], [vpnum]


Input Parameters: 
id (ival)  	Entity ID. If omitted, the currently selected 
entity is drawn. 
	If set to -1, then all entities in the selection list 
are drawn.

erase (ival)  	Erase flag:
	1 = Entity drawn using the background color, 
effectively erasing it from the screen.
	0 or omitted = Entity is drawn normally.

vpnum (ival) 	Viewport number:
	-1 = All viewports
	0 or default = Primary viewport
	positive number = Only designated viewport 


Output Parameters:
none


System Variables Set:
@ERROR (ivar)  	Error Code: 
	0 = No error
	1 = ID not found or no entity currently selected
	2 = Invalid viewport


EXEC
The EXEC  XE "program control statements:EXEC "  XE "EXEC 
" statement allows external programs or system processes to be accessed 
and run from inside the CADL program. Information may be passed to 
an external program for processing, information display, etc. 
 
When executed, this command temporarily suspends the system and 
executes the requested command(s). When the EXEC command is 
entered without parameters, the system shell is run (C> prompt) in the 
Protected Mode. To leave, type "Exit."
  
As a precaution, be sure to save the currently displayed part before 
executing any of these commands.  


Format:
EXEC [mode, "command(s)"]


Input Parameters:
mode 	Screen save mode:
	
	1 = (Suppress mode) for commands where no 
text is sent to the screen or displayed.

	2 = (Normal mode) for commands where text is 
generated and displayed. The system's graphics 
display is saved, then restored after the 
command or program process is complete. If a 
separate mono screen is present and has been 
previously specified in the configuration 
program, the text output is displayed on this 
screen, eliminating the need to save and restore 
the system's graphic image.

	3 = (Protected mode) for commands where 
graphics output is generated. This mode stores 
the system's graphics image and restores it 
afterwards, regardless of whether or not a 
separate mono screen is present.

command 	The command desired at the prompt, including 
any parameters, redirection, or pipes (refer to 
your system's manual for details on these 
commands). Each command should be separated 
by new lines. Batch commands FOR and IF are 
allowed.

Notes/Restrictions:
1) 	The system frees a specific amount of memory to 
run system commands, or processes. The amount 
that it frees is user-definable, as specified when 
the configuration program is run. This memory 
must be available when control returns to the 
system, hence no memory-resident programs 
should be loaded by the EXEC command. 
Memory-resident programs should be run before 
the system is entered.

2) 	The EXEC command does not save the part 
currently displayed first, so if a program being 
run (using EXEC) crashes, the system also 
crashes and all part data created since the last 
save is lost. It is therefore suggested that the 
current part be filed before a CADL program 
with the EXEC command is executed.

3) 	Be sure to configure for a one- or two-screen 
system correctly (using the configuration 
program) before using the CADL EXEC 
command.


EXIT
EXIT  XE "program control statements:EXIT "  XE "EXIT " causes an 
immediate exit from the CADL file being executed.  If processing of the 
current file was the result of a DOSUB from another file, control returns 
to that file. Otherwise, CADL processing is complete and control is 
returned to the CADKEY program. 


Format:
EXIT 


FNOTE
The FNOTE  XE "detail entities:file note"  XE "primitives:FNOTE "  XE 
"FNOTE " primitive is similar to the NOTE primitive except that the 
characters are strings defined in a file instead of included as part of the 
statement. 

When an FNOTE primitive is read from a CADL file, a disk note entity is 
created in the database.


Format:
FNOTE	x, y, fname, [rot], [ht], [asp], [vnum], [col], [lev], [font], 
[grpnum], [subgrp], [pen], [slnt], [fill], [lnsp], [uln], [mir]


Input Parameters:
x (double) 	X value of the lower left corner of the first line of 
text string in text's view coordinates

y (double)	Y value of the lower left corner of the first line of 
text string in text's view coordinates

fname (word) 	Text file specification. Processing of the file 
specification is as follows: 
1) If the specification does not include a path, 
the directory used is the default directory for 
CADL programs (set with the CONFIG 
program).
2)	 If a full path is included, the full path is 
used.
3)	 If the specification includes a relative 
path, the specified directory is relative to the 
current working directory.

rot (double) 	The rotation angle of the text about the XY 
coordinate (in degrees) 
	rot must be >= 0 and <= 360 degrees

ht (double)	The character height in system world units

asp (double)	The text aspect ratio (width/height)

vnum (integer) 	VIEW primitive reference number. The VIEW 
primitive referenced must precede this primitive 
or an error message is displayed and the 
program terminates.
	0 = Use current view number

col (integer) 	The color assigned to the note entity
	0-15 = Number in the system color palette

lev (integer)	Level number assigned to the note entity
	1-256 = System level number
	0 = Current system level number

font (integer) 	Text font number assigned to the note entity:
	-16 through -1 = Font number (new style)
	0 = Current system font number
	1 = Bold
	2 = Slant 
	3 = Bold box filled
	4 = Bold slant filled
	5 = Bold box
	6 = Bold slant

grpnum (integer) 	Group reference number
	1-128 = Group number
	0 = No group assignment

subgrp (integer)  	Subgroup reference number
	1-256 = Subgroup number
	0 = No subgroup assignment

Note : If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero(0), both of them will be ignored.

pen (integer) 	Pen number
	1-8 = Pen number
	0 = Use current system pen number

slnt (integer)	Text slant angle (new font style only)
	slnt must be >= -31 and <= 31 degrees
	
fill (integer)	Fill mode (new font style only)
	0 = Non-filled text
	1 = Filled text

lnsp (double) 	Line spacing factor. This factor times the 
character height 
	equals the distance between lines of text.

uln (integer) 	Underline mode
	0 = Non-underlined text
	1 = Underlined text

mir (integer)	Mirror mode
	0 = Non-mirrored text
	1 = Mirrored text


GENDIM
A GENDIM  XE "detail entities:generic dimension"  XE 
"primitives:GENDIM "  XE "GENDIM " (generic dimension) primitive 
describes the geometry and text used in a CADKEY generic dimension 
entity.

When a GENDIM primitive is read from a CADL file, a generic 
dimension entity is created in the CADKEY database in the specified 
view. The dimension's associativity is maintained, but it is not as flexible 
with modification and movement as other dimension entities in 
CADKEY.

A VIEW primitive is created first (if necessary) which the GENDIM 
primitive may reference as its definition plane.

When using a GENDIM primitive to create, all or some of the following 
entities may be used:
1) nine lines
2) two arcs
3) two arrowhead points
4) text note

Once created, parts of the dimension entity may be selected by choosing 
one of its components, such as a line or one of the two arcs, etc. A true 
CADKEY dimension moves all of the components. The only time an 
entity is treated as a whole component is when the generic selection 
menu is used.

Those functions that support the generic dimension entity in CADKEY 
include:
EDIT-BX MOV (window must surround complete dimension)

DETAIL-CHANGE:TXT ATT, TXT POS, ARROWS-STYLE #1 - #4

FILES: PART, PLOT, and CADL

DISPLAY (all)

CONTROL: PRINT, PLOT, VERIFY-ATTRIB, ATTRIB-COLOR, PEN #

DELETE: SINGLE, WINDOW, ALL DSP

X-FORM: all  (dimension value is not scaled)

Off-line Printing and Plotting


Format:
GENDIM	 form, numlines, numarcs, numarrows, arrayname, 
arrowtype, x, y, str, [rot], [ht], [asp], [vnum], [col], [lev], [fnt], 
[grpnum], [subgrp], [pen], [slnt], [fill]


Input Parameters:
form (integer) 	Dimension form number:
	0-49 = User defined
	50 = Linear dimension
	51 = Radius dimension
	52 = Diameter dimension
	53 = Angular dimension
	54 = Ordinate dimension
	55 = Point dimension (circle surrounds text)
	56 = Point dimension (hexagon surrounds text)
	57 = Flag note
	58 = Balloon note
	59-63 = Reserved

numlines (integer) 	Number of lines in dimension (range is 0-9)
	
numarcs (integer)	Number of arcs in dimension (range is 0-2)

numarrows (integer)	Number of arrowheads in dimension (range is 0-
2)

arrayname (word) 	Name of one-dimensional data array containing 
line, arc, and arrowhead data (in that order). 
Size of array is dependent upon the number of 
items.  

The data required for each item is as follows:

Line data:

x1 	X value of endpoint 1 in GENDIM's view 
coordinates
y1 	Y value of endpoint 1 in GENDIM's view 
coordinates
x2 	X value of endpoint 2 in GENDIM's view 
coordinates
y2 	Y value of endpoint 2 in GENDIM's view 
coordinates 

Arc data:

xc 	X value of arc center in GENDIM's view 
coordinates
yc 	Y value of arc center in GENDIM's view 
coordinates
rad 	arc radius
ang1 	starting angle (degrees)
ang2 	ending angle (degrees)

Note that the arc is drawn counter-clockwise from ang1 to ang2.

Arrowhead data:

X	 X value of arrowhead point in GENDIM's view 
coordinates
Y 	 Y value of arrowhead point in GENDIM's view 
coordinates
ang 	 angle of arrowhead away from point (degrees)

For example, if the dimension contains one line and one arrowhead, the 
array is set as follows:

arrayname	[0] = x1 	(line data)
	[1] = y1
	[2] = x2
	[3] = y2
	[4] = x 	(arrowhead data)
	[5] = y
	[6] = ang
arrowtype (integer)	Arrowhead type:
	0 = Style 1
	1 = Style 2
	2 = Style 3
	3 = Style 4

x (double)	X value of the lower left corner of the first line of 
the text string in the view coordinates 

y (double)	Y value of the lower left corner of the first line of 
the text string in the view coordinates

str (string)	A character string. 

rot (double) 	The rotation angle of the text about the XY 
coordinate (in degrees)
	rot must be >= 0 and <= 360 degrees

ht (double) 	The character height in system world units

asp (double) 	The text aspect ratio (width/height)

vnum (integer) 	VIEW primitive reference number. The VIEW 
primitive referenced must precede this primitive 
or an error message is displayed and the 
program is terminated.

col (integer) 	The color assigned to the note entity
	0-15 = Number in the system color palette

lev (integer) 	Level number assigned to the note entity
	1-256 = System level number
	0 = Current system level number

fnt (integer) 	Text font number assigned to the note entity:
	-16 through -1 = Font number (new style)
	0 = Current system font number
	1 = Bold
	2 = Slant
	3 = Bold box filled
	4 = Bold slant filled
	5 = Bold box
	6 = Bold slant

grpnum (integer)  	Group reference number
	1-127 = Group number
	0 = No group assignment

subgrp (integer)	Subgroup reference number
	1-256 = Subgroup number
	0 = No subgroup assignment

Note : If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero(0), both of them will be ignored.

pen (integer) 	Pen number
	1-8 = Pen number
	0 = Use current system pen number

slnt (integer)	Text slant angle (new font style only)
	slnt must be >= -31 and <= 31 degrees

fill (integer)	Fill mode (new font style only)
	0 = Non-filled text
	1 = Filled text



GETALL
GETALL  XE "GETALL " selects all of the entities residing within the 
current window boundaries. The number of entities selected is returned 
in a specified variable. Restrictions on the selectable entity types may be 
applied by using one of the SET masking statements directly preceding 
the GETALL statement.

If the selection process is successful, the GETNEXT statement is 
subsequently used to retrieve the data on selected entities one at a time 
in the order that they were selected. See GETNEXT for more information.


Format:  	
GETALL nument, [vpnum]


Input Parameter:
vpnum (ival) 	Viewport number:
	0 or default = All entities in primary viewport
	positive number = Entities within that viewport


Output Parameter:
nument (ivar)  	Number of entities selected


System Variables Set:
@ERROR (ivar)	Error Code:
	0 = No error
	1 = Selection error
	2 = Bad viewport


GETCOLOR
GETCOLOR  XE "GETCOLOR " displays a text string on the CADKEY 
prompt line along with a window of color icons and waits for one or 
more colors to be selected.


Format:
GETCOLOR prompt, retcol, [ncol], [mflg]


Input Parameters:
prompt (string)  	Text string to be displayed on the prompt line. 
The total length of the text string must not 
exceed 68 characters or truncation will occur.

ncol (ival)  	Number of selectable colors:
	0 = 256 colors
	1 = 16 colors

mflg (ival)  	Multiple selection flag, which is used only for 16 
color selection:
	0 = Return single color
	1 = Return multiple colors as mask


Output Parameter:
retcol (ivar)  	Variable to store the single color selected (0-15 
for 16 color selection; 0-255 for 256 color 
selection) or the color mask where:
	bit 0 = color 0
	bit 1 = color 1
	..
	bit 15 = color 15


System Variables Set:
@ERROR (ivar)	Error Code:
	0 	= No error 
	1 	= Exception error(CR, F10, ESC)

@KEY (ivar)	Code for last key hit: 
	-3	= ESCAPE
	-2	= F10
	-1	= CR (<Enter>)
	 0	= Value returned in "retcol"


GETCOP
GETCOP  XE "copious commands:selecting a copious entity"  XE 
"GETCOP " selects a copious entity so that its information can be 
accessed via CWRITE and CREAD commands. There are two ways in 
which to select entities; by type code or by ID. The first method involves 
specifying what type codes to select. The first entity is selected by using 
GETCOP with the ID set to -1. Each subsequent use of GETCOP, with the 
ID set to -2, selects the next matching entity. This continues until an 
error code is returned by GETCOP indicating that no matching entities 
remain. Note that non-existent type codes are effectively ignored in that 
they will not match any entities. In the second method, the entity ID is 
given. In this case, only one entity, the one with the matching ID, is 
selected.


Format:
 GETCOP id, [tcode1], ...


Input Parameters:
id (ival)  	Entity ID:
	-1 = Selection of the first entity by type code
	-2 = Selection of the next entity by type code
	positive number = Entity ID

tcode1 (ival)	First entity type code for selection. As many as 
25 codes may be specified. If no codes are 
specified all entity types are selected.


System Variables Set:
@ERROR (ivar)  	Error Code:
	0 = No error
	1 = Matching ID not found or no more entities

@CID (ivar)	Entity ID

@CTCODE (ivar)	Entity type code
	
@CSIZE (ivar)	Entity size


GETCUR
GETCUR  XE "GETCUR " displays a text string on the CADKEY prompt 
line, a menu in the CADKEY menu area and a specified cursor style, then 
waits for either a menu item to be selected or a 3D position to be picked.


Format:
GETCUR prompt, style, dspflg, [x], [y], [z], [plc], [rot], [menu1], ..., 
[menu9], [depth], [dflt]


Input Parameters:
prompt (string)  	Text string to be displayed on the prompt line. 
Optionally, the default menu item may be 
displayed in the prompt string if the format 
specifier %s is included in the prompt string 
(refer to the Introduction section of this guide 
for details on format specifiers). The total length 
of the text string, including the displayed default 
menu item, must not exceed 68 characters or 
truncation will occur.

style (ival)  	Style for cursor display:
	1 = Crosshairs
	2 = Arrow
	3 = Rubberband line
	4 = Rubberband box (display view)
	5 = Rubberband box (construction view)
	6 = Drag box (non-view dependent)
	7 = Drag box (view dependent)

	Usage of the parameters x, y, z, plc, and rot 
(described below) is dependent on the cursor 
style as shown in the following table. The 
abbreviations are: WC - world coordinates; VC - 
view coordinates; CC - cursor plane coordinates. 
A dash indicates that a parameter is not 
required.

	     style 	x 	y 	z 	plc 
	rot 	x/y/z usage
		1	-	-	-	-	-
		2	-	-	-	-	-
		3	WC 	WC 	WC	-	- 
	anchor point
		4	VC	VC	-	-	-
	anchor point
		5	CC 	CC	CC 	-	-
	anchor point
		6	VC 	VC 	- 	Yes	Yes
	drag box size
		7	VC	VC	- 	Yes 	Yes
	drag box size

dspflg (ival)	If set to 0, no cross is drawn at the cursor pick 
position. If set to 1, the position cross is drawn.

x (fval)   	X value of anchor point or width of drag box

y (fval)   	Y value of anchor point or height of drag box

z (fval) 	Z value of anchor point

plc (word)   	Two-letter keyword to indicate position of 
cursor placement in drag box. The first letter 
defines horizontal placement and the second 
defines vertical placement.

	Horizontal 	Vertical
	L = left 	T = top
	C = center  	C = center
	R = right  	B = bottom

rot (fval) 	Rotation angle of drag box
	rot must be >= 0 and <= 360 degrees

menu1 (string)  	Text string to be displayed in the first CADKEY 
menu position. The total length of the text string 
must not exceed eight characters or truncation 
will occur.

menu9 (string)  	Text string to be displayed in the ninth CADKEY 
menu position. The total length of the text string 
must not exceed eight characters or truncation 
will occur.

depth (ivar)  	History depth. A positive value (1 - n) causes the 
selected menu item to be displayed in the 
CADKEY history line at the specified position. If 
set to 0 or not supplied (the default), the history 
line is not modified.

dflt (ivar)  	Default menu item. This can be set to any value 
from 1 - n, where 'n' is the number of menu 
items displayed. If the user types the <Enter> 
key instead of a function button or cursor 
selection, this value is returned as the menu item 
selected. For example, if dflt is passed as 3 and 
<Enter> is typed, @key will contain the value 3 -- 
the same as if F3 is typed. If "dflt" is set to zero or 
not supplied (the default), the value returned in 
@key for the <Enter> key is -1 and no processing 
of the "%s" specifier takes place.  


System Variables Set:
@ERROR (ivar) 	Error Code:
	0 = No error
	1 = Exception error (CR, F10, or ESC)

@KEY (ivar)  	Code for last key hit:
	-3	= ESCAPE
	-2	= F10
	-1	= CR (<Enter>)
	 0	= Position returned
	 1	= F1
	 2	= F2
	 . 
	 .
	 9	= F9

@XVIEW (fvar)  	X coordinate of position found (in view 
coordinates)

@YVIEW (fvar)  	Y coordinate of position found (in view 
coordinates)

@ZVIEW (fvar)  	Z coordinate of position found (in view 
coordinates)

@XCVIEW (fvar) 	X coordinate of position found (in construction 
view coordinates)

@YCVIEW (fvar) 	Y coordinate of position found (in construction 
view coordinates)

@ZCVIEW (fvar) 	Z coordinate of position found (in construction 
view coordinates)

@XWORLD (fvar)  	X coordinate of position found (in world 
coordinates)

@YWORLD (fvar)  	Y coordinate of position found (in world 
coordinates)

@ZWORLD (fvar)  	Z coordinate of position found (in world 
coordinates)


GETENT
GETENT  XE "GETENT " displays a text string on the CADKEY prompt 
line, activates the graphics cursor, and waits until an entity is selected 
before returning control to the CADL program. The numeric entity type 
code and ID are returned in specified variables.  Other entity data is 
returned in specified variable arrays or system variable arrays. 
Restrictions on the selectable entity types may be applied by using any of 
the SET masking statements preceding the GETENT  statement. 


Format:
GETENT prompt, enttype, [id], [fdat], [idat], [sdat], [mdat]
 

Input Parameter: 
prompt (string)  	Text string to be displayed on the prompt line. 
The total length of the text string must not 
exceed 68 characters or truncation will occur. 
 

Output Parameters: 
enttype (ivar)  	Returned type code for entity selected. See Entity 
Information in the Appendices for a list of entity 
codes.

id (ivar) 	Entity ID

fdat (fvar) 	Variable name of array in which to return 
entity's floating point data. The sizeof() function 
can be used to determine the number of elements 
in the array. If this parameter is omitted, the 
floating point data will be put into @FLTDAT.

idat (ivar) 	Variable name of array in which to return 
entity's integer data. The sizeof() function can be 
used to determine the number of elements in the 
array. If this parameter is omitted, the integer 
data will be put into @INTDAT.

sdat (cvar) 	Variable name of array in which to return 
entity's character data. The sizeof() function can 
be used to determine the number of elements in 
the array. If this parameter is omitted, the 
character data will be put into @STRDAT.

mdat (fvar) 	Variable name of array in which to return 
entity's miscellaneous data. The sizeof() function 
can be used to determine the number of elements 
in the array. If this parameter is omitted, the 
data will be put into @MSCDAT.
 

System Variables Set: 
@ERROR (ivar)  	Error Code:
	0 = No error
	1 = Selection error
	2 = Entity too large for system arrays
	3 = Can't create variable array

@KEY (ivar)  	Code for last key hit:
	3 = ESCAPE
	2 = F10
	1 = CR (<Enter>)
	0 = Entity selected

@NUMINT (ivar)  	Number of integer values in @INTDAT array. 

@INTDAT[] (ivar)	Array of integer data for the entity selected. The 
contents of this array are dependent upon the 
entity selected. Refer to Entity Information in the 
Appendices for information on the contents of 
@INTDAT for each entity type. 
   
@NUMFLT (ivar)  	Number of floating point values in @FLTDAT 
array. 
 
@FLTDAT[] (fvar)	Array of floating point data for the entity 
selected. The contents of this array are 
dependent upon the entity selected. Refer to 
Entity Information in the Appendices for 
information on the contents of @FLTDAT for 
each entity type. 
 
@NUMSTR (ivar)	Number of character values in @STRDAT array. 
 
@STRDAT[] (cvar)	Array of character data for the entity selected. 
The contents of this array are dependent upon 
the entity selected. Refer to Entity Information in 
the Appendices for information on the contents 
of @STRDAT for each entity type. 

@MSCDAT[] (var)	Array of miscellaneous data for the entity 
selected. The contents of this array are 
dependent upon the entity selected. Refer to 
Entity Information in the Appendices for 
information on the contents of @MSCDAT for 
each entity type.



GETENTID
GETENTID  XE "GETENTID " selects the entity having the given ID.  The 
numeric entity type code is returned in the specified variable.  Other 
entity data is returned in specified variable arrays or system variable 
arrays.


Format:.	
GETENTID id, enttype, [fdat], [idat], [sdat], [mdat]

Input Parameter:
id (ival)	Entity ID


Output Parameters:
enttype (ivar) 	Returned type code for entity selected.  See 
Entity Information in the Appendices for a list of 
entity codes.

fdat (fvar)  	Variable name of array in which to return 
entity's floating 	
	point data. The sizeof() function can be used to 
determine the number of elements in the array.  
If this parameter is omitted, the floating point 
data will be put into @FLTDAT.

idat (ivar)  	Variable name of array in which to return 
entity's integer data. The sizeof() function can be 
used to determine the number of elements in the 
array.  If this parameter is omitted, the integer 
data will be put into @INTDAT.

sdat (cvar) 	Variable name of array in which to return 
entity's character data.  The sizeof() function can 
be used to determine the number of elements in 
the array.  If this parameter is omitted, the 
character data will be put into @STRDAT.

mdat (fvar) 	Variable name of array in which to return 
entity's miscellaneous data. The sizeof() function 
can be used to determine the number of elements 
in the array. If this parameter is omitted, the 
data will be put into @MSCDAT.


System Variables Set:
@ERROR (ivar)  	Error Code:
	0 = No error
	1 = Selection error
	2 = Entity too large for arrays
	3 = Can't create variable array

@NUMINT (ivar) 	Number of integer values in @INTDAT array.

@INTDAT[] (ivar) 	Array of integer data for the entity selected. The 
contents of this array are dependent upon the 
entity selected.  Refer to Entity Information in 
the Appendices of this manual for information 
on the contents of @INTDAT for each entity 
type.

@NUMFLT (ivar)	Number of floating point values in @FLTDAT 
array.
	
@FLTDAT[] (fvar) 	Array of floating point data for the entity 
selected. The contents of this array are 
dependent upon the entity selected.  Refer to 
Entity Information in the Appendices for 
information on the contents of @FLTDAT for 
each entity type.

@NUMSTR (ivar) 	Number of character values in @STRDAT array.

@STRDAT[] (cvar) 	Array of character data for the entity selected. 
The contents of this array are dependent upon 
the entity selected.  Refer to Entity Information 
in the Appendices  for information on the 
contents of @STRDAT for each entity type.

@MSCDAT[] (var) 	Array of miscellaneous data for the entity 
selected. The contents of this array are 
dependent upon the entity selected.  Refer to 
Entity Information in the Appendices for 
information on the contents of @MSCDAT for 
each entity type.



GETENTM
GETENTM  XE "GETENTM " invokes the CADKEY general selection 
mechanism and waits until one or more entities are selected before 
returning control to the CADL program. The number of entities selected 
is returned in a specified variable. Restrictions on the selectable entity 
types may be applied by using any of the SET masking statements 
directly preceding the GETENTM statement. 

If the selection process is successful, the GETNEXT statement is 
subsequently used to retrieve the data on selected entities one at a time 
in the order that they were selected. See GETNEXT for more information. 
  

Format:
GETENTM selopt, nument 


Input Parameter: 
 selopt (ival)  	Entity selection option:
	1 = Single 
	2 = Chain 
	3 = Window 
	4 = Polygon
	5 = Group
	6 = Plane
	7 = All Displayed


Output Parameter: 
nument (ivar)  	Number of entities selected
System Variables Set: 
@ERROR (ivar)	Error Code:
	0 = No error
	1 = Selection error

@KEY (ivar)  	Code for last key hit:
	-3	= ESCAPE
	-2	= F10
	-1	= CR (<Enter>)
	 0	= Entities selected
 

GETENTXY
GETENTXY  XE "GETENTXY " selects an entity at the given X, Y view 
position. The numeric entity type code and ID are returned in specified 
variables.  Other entity data is returned in specified variable arrays or 
system variable arrays. Restrictions on the selectable entity types may be 
applied by using any of the SET masking statements preceding the 
GETENTXY statement.


Format:
GETENTXY x, y, enttype, [vpnum], [id], [fdat], [idat], [sdat], [mdat]


Input Parameters:
x (fval)  	X view position of  the entity

y (fval)  	Y view position of the entity

vpnum (ival)	Viewport number:  
	0 or default = Primary viewport
	positive number = Specified viewport is used


Output Parameters:
enttype (ival) 	Returned type code for the entity selected. See 
Entity Information in the Appendices for a list of 
entity codes.

id (ivar) 	Entity ID

fdat (fvar) 	Variable name of array in which to return the 
entity's floating point data. The sizeof() function 
can be used to determine the number of elements 
in the array. If this parameter is omitted, the 
floating point data will be put into @FLTDAT.

idat (ivar) 	Variable name of array in which to return the 
entity's integer data. The sizeof() function can be 
used to determine the number of elements in the 
array. If this parameter is omitted, the integer 
data will be put into @INTDAT.

sdat (cvar) 	Variable name of array in which to return the 
entity's character data. The sizeof() function can 
be used to determine the number of elements in 
the array. If this parameter is omitted, the 
character data will be put into @STRDAT.

mdat (fvar) 	Variable name of array in which to return the 
entity's miscellaneous data. The sizeof() function 
can be used to determine the number of elements 
in the array. If this parameter is omitted, the 
data will be put into @MSCDAT.


System Variables Set:
@ERROR (ivar) 	Error Code: 
	0 = No error
	1 = Selection error
	2 = Entity too large for system arrays
	3 = Illegal viewport number
	4 = Can't create variable array

@KEY (ivar) 	Code for last key hit:
	-3	= ESCAPE
	-2	= F10
	-1	= CR (<Enter>)
	 0	= Entity selected

@NUMINT (ivar) 	Number of integer values in @INTDAT array.

@INTDAT[] (ivar) 	Array of integer data for the entity selected. The 
contents of this array are dependent upon the 
entity selected. Refer to Entity Information in the 
Appendices for information on the contents of 
@INTDAT for each entity type.

@NUMFLT (ivar) 	Number of floating point values in @FLTDAT 
array.

@FLTDAT[] (fvar) 	Array of floating point data for the entity 
selected. The contents of this array are 
dependent upon the entity selected. Refer to 
Entity Information in the Appendices for 
information on the contents of @FLTDAT for 
each entity type.

@NUMSTR (ivar) 	Number of character values in @STRDAT array.

@STRDAT[] (cvar)	Array of character data for the entity selected. 
The contents of this array are dependent upon 
the entity selected. Refer to Entity Information in 
the Appendices for information on the contents 
of @STRDAT for each entity type.

@MSCDAT[](var) 	Array of miscellaneous data for the entity 
selected. The contents of this array are 
dependent upon the entity selected. Refer to 
Entity Information in the Appendices  for 
information on the contents of @MSCDAT for 
each entity type.


GETFLT
GETFLT  XE "GETFLT " displays a text string on the CADKEY prompt 
line and a menu in the CADKEY menu area, then waits for either a menu 
item to be selected or a numeric real value to be entered. If a menu item 
is selected, the number is returned in the system variable @KEY. If a real 
value is entered instead, its value is stored in the specified floating point 
variable.
 

Format:
GETFLT prompt, defflt, retflt, [menu1], ..., [menu 9], [depth]
 

Input Parameters: 
 prompt (string)	Text string to be displayed on the prompt line. 
Optionally, the default value "defflt" may be 
displayed in the prompt string if the format 
specifier %f is included in the prompt string 
(refer to Basics for details on format specifiers). 
	The total length of the text string, including the 
displayed default value as well as the returned 
typed-in number, must not exceed 68 characters 
or truncation will occur.
 
defflt (fval) 	Default floating point value. If <Enter> is 
pressed without supplying a value, this value is 
returned. 

menu1 (string)  	Text string to be displayed in the first CADKEY 
menu position. The total length of the text string 
must not exceed eight characters or truncation 
will occur.
	
menu9 (string) 	Text string to be displayed in the ninth CADKEY 
menu position. The total length of the text string 
must not exceed eight characters or truncation 
will occur.

depth (ivar) 	History depth. A positive value (1 - n) causes the 
selected menu item to be displayed in the 
CADKEY history line at the specified position. If 
set to 0 or not supplied (the default), the history 
line is not modified.
 

Output Parameter: 
 retflt (fvar)  	Variable to store return value
 

System Variables Set: 
 @ERROR (ivar)	Error Code:
	0 = No error
	1 = Exception exit (F10 or ESC)
 
@KEY (ivar)	Code for last key hit:
	-3	= ESCAPE
	-2	= F10
	 0	= Value returned in "retflt"
	 1	= F1
	 2	= F2
	 .
	 .
	 9	= F9


GETGROUP
GETGROUP  XE "GETGROUP " retrieves group name and subgroup 
flags for the specified group. The data is returned via @INTDAT and 
@STRDAT.


Format:
GETGROUP grpnum


Input Parameter: 
grpnum (ival)	Group number (1-127)


Output Parameters:
none


System Variables Set:
@ERROR (ivar)  	Error code: 
	0 = No error
	1 = Invalid group number
	2 = Cannot create system array

@NUMINT (ivar) 	Number of @INTDAT elements (32)

@INTDAT[0-31] (ivar)  	Subgroup flags

@NUMSTR (ivar)  	Number of @STRDAT characters (1-10)

@STRDAT (cvar)  	Group name

	There are eight subgroup flags per @INTDAT 
element - the low order bits 0-7. This yields a 
total of 256 subgroups. The flags are arranged 
such that bits 0-7 of @INTDAT[0] correspond to 
subgroups 1-8, bits 0-7 of @INTDAT[1] 
correspond to subgroups 9-16, etc. If the value of 
a flag is 0, the subgroup is not used. If set to 1, 
the subgroup is used.

	If the group name has a null length (i.e., 
@STRDAT[0] contains a zero), then the group is 
not assigned.


GETINT
GETINT  XE "GETINT " displays a text string on the CADKEY prompt 
line and a menu in the CADKEY menu area, then waits for either a menu 
item to be selected or a numeric integer value to be entered. If a menu 
item is selected, the number is returned in the system variable @KEY. If 
an integer value is entered instead, its value is stored in the specified 
integer variable. 
 

Format:
GETINT prompt, defint, retint, [menu1], ..., [menu9], [depth]
 

Input Parameters: 
 prompt (string)	Text string to be displayed on the prompt line. 
Optionally, the default value "defint" may be 
displayed in the prompt string if the format 
specifier %d is included in the prompt string 
(refer to the Introduction section of this guide 
for details on format specifiers). The total length 
of the text string, including the displayed default 
value, as well as the returned typed-in number, 
must not exceed 68 characters or truncation will 
occur. 
 
defint (ival) 	Default integer value. If <Enter> is pressed 
without supplying a value, this value is 
returned. 

menu1 (string)  	Text string to be displayed in the first CADKEY 
menu position. The total length of the text string 
must not exceed eight characters or truncation 
will occur.

menu9 (string)  	Text string to be displayed in the ninth CADKEY 
menu position. The total length of the text string 
must not exceed eight characters or truncation 
will occur.

depth (ivar)  	History depth. A positive value (1 - n) causes the 
selected menu item to be displayed in the 
CADKEY history line at the specified position. If 
set to 0 or not supplied (the default), the history 
line is not modified.
 

Output Parameter: 
retint (ivar)  	Variable to store return value
System Variables Set: 
 @ERROR (ivar)	Error code: 
	0 = No error
	1 = Exception exit (F10 or ESC)

@KEY (ivar)  	Code for last key hit: 
	-3	= ESCAPE
	-2	= F10
	 0	= Value returned in "retint"
	 1	= F1
	 2	= F2
	 .
	 .
	 9	= F9
 

GETKEY
GETKEY  XE "GETKEY " checks the system keyboard buffer and returns 
a character code if a key is pressed. Note that the actual ASCII value of 
the key is returned, even for ESCAPE, BACKUP, and CR (<Enter>). 

Format:
GETKEY [wflag]


Input Parameter: 
wflag (ival)  	Wait flag:
	0 or default = System keyboard buffer is checked 
with "no wait" (i.e., if no key is available, 
@ERROR is set to 1). 
	1 = CADL waits until a key is pressed if the 
system keyboard buffer is empty.
Output Parameters:
none

System Variables Set:
@ERROR (ivar)	Error code:
	0 = Key entered
	1 = No key entered
	
@KEY (ivar)  	Code for last key hit:
	0 = No key entered
	n = Key value (e.g., 65 for letter 'A')


GETLTYPE
GETLTYPE  XE "GETLTYPE " displays a text string on the CADKEY 
prompt line along with a window of line type icons and waits for one or 
more line types to be selected.


Format:
GETLTYPE prompt, rettype, [mflg]

Input Parameters:
prompt (string)  	Text string to be displayed on the prompt line. 
The total length of the text string must not 
exceed 68 characters or truncation will occur.

mflg (ival)	Multiple selection flag:
	0 (default) = Return single line type
	1 = Return multiple line types as mask
Output Parameter:
rettype (ivar)  	Variable to store the single line type selected (1-
4) or the line type mask where:
	bit 0 = Solid
	bit 1 = Dashed
	bit 2 = Center line
	bit 3 = Phantom line

System Variables Set:
@ERROR (ivar) 	Error code: 
	0 = No error
	1 = Exception error (CR, F10, ESC)

@KEY (ivar)   	Code for last key hit: 
	-3	= ESCAPE
	-2	= F10
	-1	= CR (<Enter>)
	 0	= Value returned in "rettype"


GETLWIDTH
GETLWIDTH  XE "GETLWIDTH " displays a text string on the CADKEY 
prompt line along with a window of line width icons and waits for one 
or more line widths to be selected.


Format:
GETLWIDTH prompt, retwdt, [mflg]


Input Parameters:
prompt (string) 	Text string to be displayed on the prompt line. 
The total length of the text string must not 
exceed 68 characters or truncation will occur.

mflg (ival) 	Multiple selection flag: 
	0 (default) = Return single line width
	1 = Return multiple line widths as mask


Output Parameter:
retwdt (ivar)  	Variable to store the single line width selected(1-
15) or the line width mask where:
	bit 0 = Width 1
	bit 2 = Width 3
	bit 4 = Width 5
	.
	.
	bit 14 = Width 15


System Variables Set:
@ERROR (ivar)	Error code: 
	0 = No error
	1 = Exception error (CR, F10, ESC)

@KEY (ivar) 	 Code for last key hit: 
	-3	= ESCAPE
	-2	= F10
	-1	= CR (<Enter>)
	 0	= Value returned in "retwdt"


GETMENU
GETMENU  XE "GETMENU " displays a text string on the CADKEY 
prompt line and a menu in the CADKEY menu area, then waits until a 
menu item is selected. The menu item chosen is returned in the system 
variable @KEY. 


Format:
GETMENU prompt, [menu1], [menu2], ..., [menu9], [depth], [dflt]
 

Input Parameters: 
prompt (string)	Text string to be displayed on the CADKEY 
prompt line. The total length of the text string 
must not exceed 68 characters or truncation will 
occur. Optionally, the default menu item "dflt" 
may be displayed in the prompt string if the 
format specifier %s is included in the prompt 
string (refer to Basics for details on format 
specifiers).

menu1 (string)  	Text string to be displayed in the first CADKEY 
menu position. The total length of the text string 
must not exceed eight characters or truncation 
will occur. 
			.	 
			.
menu9 (string)	Text string to be displayed in the ninth CADKEY 
menu position. The total length of the text string 
must not exceed eight characters or truncation 
will occur. 

depth (ival)	History depth. If set to positive value (1-n), 
causes the selected menu item to be displayed in 
the CADKEY History Line at the specified 
position. If set to 0 or the default, history line is 
not modified.

dflt (ival)  	Default menu item. This can be set to any value 
from 1 to n where 'n' is the number of menu 
items displayed. If the user types the <Enter> 
key instead of a function button, this value is 
returned as the menu item selected. For example, 
if dflt is passed as 3 and <Enter> is typed, @key 
will contain the value 3, the same as if F3 is 
typed. If dflt is set to zero or not supplied (the 
default), the value returned in @key for the 
<Enter> key is -1 and no processing of the %s 
specifier takes place.

System Variables Set: 
@ERROR (ivar)	Error code: 
	0 = No error
	1 = Exception exit (CR, F10, or ESC)
 
@KEY (ivar)  	Code for last key hit: 
	-3	= ESCAPE
	-2	= F10
	-1	= CR (<Enter>)
	 1	= F1
	 2	= F2
	 .
	 .
	 9	= F9


GETNEXT
GETNEXT  XE "GETNEXT " retrieves the data for selected entities one at 
a time after GETENTM or GETALL has been successfully executed. If 
GETNEXT is successful, the numeric entity type code and ID are 
returned in specified variables. Other entity data is returned in specified 
variable arrays or system variable arrays. 
 
There are two ways in which to use GETNEXT: with or without the 
entity selection number parameter. If used without the entity selection 
number parameter, each GETNEXT statement gets the next selected 
entity in the list. Once the list is expired, an error code indicating such is 
returned, and the internal pointer to the selected entities is set back to 
the start of the list.  Subsequent GETNEXT commands will work through 
the list once again. If GETNEXT is used with the entity selection number, 
the specified entity is returned. Note that if the next GETNEXT 
command does not specify the optional parameter, the next entity in the 
list is returned. 


Format:
GETNEXT enttype, [selnum], [id], [fdat], [idat], [sdat], [mdat]


Input Parameter: 
 selnum (ival)  	Entity selection number. Must be in the range of 
1-n where n is the number of entities returned by 
GETENTM. 
 

Output Parameters: 
 enttype (ivar) 	Returned type code for entity selected.  See 
Entity Information in the Appendices for a list of 
entity codes.

id (ivar) 	Entity ID

fdat (fvar) 	Variable name of array in which to return the 
entity's floating point data. The sizeof() function 
can be used to determine the number of elements 
in the array. If this parameter is omitted the 
floating point data will be put into @FLTDAT.

idat (ivar) 	Variable name of array in which to return the 
entity's integer data. The sizeof() function can be 
used to determine the number of elements in the 
array. If this parameter is omitted, the integer 
data will be put into @INTDAT.

sdat (cvar) 	Variable name of array in which to return the 
entity's character data. The sizeof() function can 
be used to determine the number of elements in 
the array. If this parameter is omitted, the 
character data will be put into @STRDAT.

mdat (fvar) 	Variable name of array in which to return the 
entity's miscellaneous data. The sizeof() function 
can be used to determine the number of elements 
in the array. If this parameter is omitted, the 
data will be put into @MSCDAT.


System Variables Set: 
@ERROR (ivar)  	Error code: 
	0 = No error 
	1 = Syntax error 
	2 = Entity too large for arrays
	3 = No more entities or entity number out of 
range 
	4 = Can't create variable array

@NUMINT(ivar)  	Number of integer values in @INTDAT array. 

@INTDAT[](ivar)  	Array of integer data for the entity selected. The 
contents of this array are dependent upon the 
entity selected. Refer to Entity Information in the 
Appendices for information on the contents of 
@INTDAT for each entity type. 

@NUMFLT(ivar)  	Number of floating point values in @FLTDAT 
array. 

@FLTDAT[](fvar) 	Array of floating point data for the entity 
selected. The contents of this array are 
dependent upon the entity selected. Refer to 
Entity Information in the Appendices of this 
guide for information on the contents of 
@FLTDAT for each entity type. 
 
@NUMSTR(ivar)  	Number of floating point values in @STRDAT 
array. 

@STRDAT[](cvar)  	Array of character data for the entity selected. 
The contents of this array are dependent upon 
the entity selected. Refer to Entity Information in 
the Appendices of this guide for information on 
the contents of @STRDAT for each entity type. 

@MSCDAT[] (var)  	Array of miscellaneous data for the entity 
selected. The contents of this array are 
dependent upon the entity selected. Refer to 
Entity Information in the Appendices for 
information on the contents of @MSCDAT for 
each entity type.


GETPLANE
GETPLANE  XE "GETPLANE " displays a text string on the CADKEY 
prompt line along with the CADKEY plane selection menu. After 
choosing a method for plane selection from the menu and selecting the 
plane, control is returned to the CADL program. For more information 
on the usage of the options in the plane selection menu, refer to the 
CADKEY or CUTTING EDGE User Reference Guide.  The data for the 
plane selected is returned in either a specified array variable or a system 
array variable (default). 


Format:
GETPLANE prompt, dspflg, [rtnpln]

Input Parameters: 
prompt (string)  	Text string to be displayed on the CADKEY 
prompt line. The total length of the text string 
must not exceed 68 characters or truncation will 
occur. 

dspflg (ival)	If set to 0, no plane icon is drawn. If set to 1, a 
plane icon (or figure) is drawn representing the 
orientation of the plane. 

Output Parameter: 
rtnpln (fvar) 	Name of variable for returned plane data. If not 
supplied, plane data is returned in @FLTDAT. 
The variable must be an array variable or not 
have been previously used. On return from 
GETPLANE the variable will be one-dimensional 
and contain 14 elements.
System Variables Set: 
@ERROR (ivar)	Error code: 
	0	= No error
	1	= Exception exit (F10 or ESC)
	2	= Cannot create system array

@KEY (ivar)	Code for last key hit: 
	-3	= ESCAPE
	-2	= F10
	 0	= Plane selected, values in specified variable  

@NUMFLT (ivar)	Number of @FLTDAT values (14) 
	
@FLTDAT[0](fvar)	Depth of plane in view matrix 

@FLTDAT[1-9] (fvar) 	View matrix 

	Elements in the rotation matrix are in the 
following order:

	|	@FLTDAT[1]	@FLTDAT[2]
	@FLTDAT[3]	|
	|	@FLTDAT[4] 	@FLTDAT[5] 
	@FLTDAT[6]	|
	|	@FLTDAT[7] 	@FLTDAT[8]
	@FLTDAT[9]	|
		
	This 3 X 3 rotation matrix defines the X, Y, and Z 
axis rotation about the part model origin (X = 0, 
Y = 0, Z = 0) relative to model space, or the 
system's view 1 (TOP view). In this system, X is 
the horizontal axis, Y is the vertical axis, and Z is 
the axis pointing out of the plane. 

	The following characteristics apply to the view 
rotation matrix:
		
	1. It is orthogonal in the linear algebraic sense 
(i.e., its transpose is its inverse).
	2. It has a positive determinant.

	Refer to the CADL Appendices for matrix 
examples.

	@FLTDAT[10-13] (fvar)	Planar 
coefficients:
			[10] = a
			[11] = b			
			[12] = c
			[13] = d
	
	Represent these coefficients of the general plane 
equation:
		
	ax  + by + cz + d = 0


GETPOS
GETPOS  XE "GETPOS " displays a text string on the first half of the 
CADKEY prompt line along with the CADKEY position menu and waits 
until a 3D position in space is indicated using one of the options 
provided by the position menu (refer to the CADKEY or CUTTING 
EDGE User Reference Guide for more information on the usage of the 
Universal Position Menu). 


Format:
GETPOS prompt, defopt 
 

Input Parameters: 
prompt (string)	Text string to be displayed on the prompt line. 
The total length of the text string must not 
exceed 38 characters or truncation will occur. 
 
defopt (ival) 	Default position menu option (1-9). This may be 
overridden by the user when the menu is 
displayed. 
 
System Variables Set: 
@ERROR (ivar)  	Error code:
	0 = No error
	1 = Exception exit (CR, F10, or ESC)

@KEY (ivar)  	Code for last key hit:
	-3	= ESCAPE 
	-2	= F10 
	-1	= CR (<Enter>) 
	 1	= F1 
	 2	= F2 
	 . 
	 . 
	 9	= F9
 
@XVIEW (fvar)  	X coordinate of position found (in view 
coordinates) 

@YVIEW (fvar)	Y coordinate of position found (in view 
coordinates) 

@ZVIEW (fvar) 	Z coordinate of position found (in view 
coordinates) 

@XWORLD (fvar) 	X coordinate of position found (in world 
coordinates) 

@YWORLD (fvar)  	Y coordinate of position found (in world 
coordinates) 

@ZWORLD (fvar)  	Z coordinate of position found (in world 
coordinates) 

@XCVIEW (fvar)  	X coordinate of position found (in construction 
coordinates)

@YCVIEW (fvar) 	Y coordinate of position found (in construction 
coordinates)

@ZCVIEW (fvar)  	Z coordinate of position found (in construction 
coordinates)
 

GETSTR
GETSTR  XE "GETSTR " displays a text string on the CADKEY prompt 
line and a menu in the CADKEY menu area, then waits for either a menu 
item to be selected or a text string to be entered. If a menu item is 
selected, the number is returned in the system variable @KEY. If a text 
string is entered instead, its value is stored in the specified string 
variable.


Format:
GETSTR prompt, defstr, retstr, [menu1], ..., [menu9], [depth]


Input Parameters:
prompt (string)   	Text string to be displayed on prompt line. 
Optionally, the default value "defstr" may be 
displayed in the prompt string if the format 
specifier %s is included in the prompt string 
(refer to the Introduction section of this guide 
for details on format specifiers).  The total length 
of the text string, including the displayed default 
value as well as the returned typed in string, 
must not exceed 68 characters or truncation will 
occur.

defstr (string)  	Default string. If <Enter> is pressed without 
supplying a string, the default string is returned.

menu1 (string)  	Text string to be displayed in the first CADKEY 
menu position. The total length of the text string 
must not exceed eight characters or truncation 
will occur.

menu9 (string)  	Text string to be displayed in the ninth CADKEY 
menu position. The total length of the text string 
must not exceed eight characters or truncation 
will occur.

depth (ivar)  	History depth. A positive value (1 - n) causes the 
selected menu item to be displayed in the 
CADKEY history line at the specified position. If 
set to 0 or not supplied (the default), the history 
line is not modified.


Output Parameter:
retstr (cval)  	Variable to store return string. Variable name 
must begin with a '$' character. The returned 
string will be a null terminated array of 
characters.


System Variables Set:
@ERROR (ivar)	Error code: 
	0 = No error
	1 = Exception exit (F10 or ESC)
@KEY (ivar)  	Code for last key hit:
	-3	= ESCAPE
	-2	= F10
	 0	= Value returned in "retstr"
	 1	= F1
	 2	= F2
	 .
	 . 
	 9	= F9


GETVIEW
GETVIEW  XE "GETVIEW " retrieves the specified system view matrix 
and stores it in the retvw array or the system array @FLTDAT.


Format:
GETVIEW vnum [, retvw]
 

Input Parameters: 
 vnum (ival)  	System view number 


Output Parameters: 
retvw (fval) 	Return view matrix. If not supplied, a nine 
element view matrix is put into @FLTDAT[0] - 
@FLTDAT[8]. If retvw is specified, the view 
matrix is put into that variable instead. The 
variable must be an array variable or not have 
been previously used. On return from GETVIEW 
the variable will be one-dimensional and contain 
nine elements.


System Variables Set: 
 @ERROR (ivar)  	Error code: 
	0 = No error
	1 = View not defined 
	2 = Cannot  create system array
	 
@NUMFLT (ivar)  	Number of @FLTDAT values (9) 
 
@FLTDAT[0-8] (fvar) 	View matrix, where:

	Elements in the rotation matrix are in the 
following order:
		
	|   @FLTDAT[0] 	@FLTDAT[1] 
	@FLTDAT[2]   |
	|   @FLTDAT[3] 	@FLTDAT[4] 
	@FLTDAT[5]   |
	|   @FLTDAT[6] 	@FLTDAT[7] 
	@FLTDAT[8]   |

	This 3 X 3 rotation matrix defines the X, Y, and Z 
axis rotation about the part model origin (X = 0, 
Y = 0, Z = 0) relative to model space, or the 
system's view 1 (TOP view). In this system, X is 
the horizontal axis, Y is the vertical axis, and Z is 
the axis pointing out of the plane. 
		
	The following characteristics apply to the view 
rotation matrix:
		
	1. It is orthogonal in the linear algebraic sense 
(i.e., its transpose is its inverse).
	2. It has a positive determinant.


GOTO
GOTO  XE "program control statements:GOTO "  XE "GOTO " causes 
execution to branch to the statement immediately following the 
specified label. Normally CADL processes each statement in sequence 
from the beginning to the end of the file. The GOTO statement must be 
followed by a label name. 


Format:
GOTO label 

GROUP
The GROUP  XE "primitives:GROUP "  XE "GROUP " primitive is output 
by the program's CADL, OUTPUT, GRP TBL function.  The GROUP 
primitive may also be read in by a CADL file execution to create a group 
and subgroup in the system's database. If the group and subgroup 
already exist, an attempt is made by the system to use them. Note that a 
group and subgroup must be created prior to its first reference in a 
CADL primitive.

If the GROUP primitive is output to a CADL file, a check is performed in 
the GRP.TXT file to see if any text data is associated with this particular 
group. If so, the fields of text data are dumped in the form of REM GRP 
statements, with each field of data displayed inside of double quotes in a 
REM GRP record. 

Format:
GROUP "grpname", grpnum, nsubgrps


Input Parameters:
grpname (string)  	A string of up to eight characters, contained in 
double quotes,  representing the name of the 
group.

grpnum (integer)	Group reference number
	1-127 = Group number
	0 = No group assigned
nsubgrps (integer)	Number of subgroups (1-256)
	0 = No subgroups assigned


HALF
HALF  XE "scaling:half"  XE "HALF "  XE "viewports:half scale"  XE 
"viewports:zoom-out" performs a "zoom-out" on a part by dividing the 
current part scale factor by two. This performs the same function as 
using the system's Immediate Mode command, except that an automatic 
redraw is not performed. 


Format:
HALF [vpnum]


Input Parameter:  
vpnum (ival)  	Viewport number: 
	-1 = All viewports
	0 or default = Primary viewport
	positive number = Only designated viewport 


Output Parameters:  
none


System Variables Set:
@ERROR	0 = No error
	1 = Invalid viewport


IF
 XE "IF" In the IF  XE "program control statements:IF " statement, the 
expression following the IF clause (expr) is first evaluated. Then, if the 
expression is true (nonzero), the statement following the IF clause is 
executed. If the expression if false (zero), the statement following the IF 
clause is ignored. The program then continues with the statement 
following the compound IF statement.


Format:
IF (expr)
	statement


INPUT
INPUT  XE "INPUT " reads characters, integers, and floating point 
numbers from the current standard input device in a variety of ways 
through the use of a format string. INPUT is a more flexible alternative 
to the READ statement. The format string contains any number of field 
specifiers which are used to describe how input data should be read and 
converted to variable values. For each specifier, a variable name is 
parsed from the statement and set accordingly. Unlike the READ 
statement, only one element of an array can be set at a time. Refer to the 
Introduction section of this CADL guide for a description of field 
specifiers. 
 
The device through which input is read is the standard input device.  At 
each CADL invocation, the input device is usually the console keyboard 
(as with CADKEY). However, if the input redirection symbol (<) is used 
when CADKEY is initiated, the input device will be the redirection name 
(refer to your system's User's Manual for more information on 
input/output redirection). 

The input device can be changed at any time to another device or to a 
file by using the SET DEVIN command. The new device or file will be in 
effect until CADL processing is completed, another SET DEVIN 
command is processed, or a CLOSE DEVIN is processed.

If your system is configured for a one monitor setup, anything entered 
from the keyboard will appear in the upper left corner. 


Format:
INPUT format [, var1, ...] 


Input Parameter: 
format (string) 	Format control string 
 

Output Parameter: 
var1 (var)  	Name of first variable to set based on first field 
specifier
 

System Variables Set: 
@ERROR (ivar)	Error code: 
	0 = No error
	1 = DEVIN not open
 
@NREAD (ivar)	 Number of fields successfully converted 


INQCTYPE
INQCTYPE  XE "copious commands:retrieve type name"  XE 
"INQCTYPE " returns the name of a copious entity type given its type 
code.


Format:
INQCTYPE tcode, name


Input Parameter:  
tcode (ival)  	Entity type code


Output Parameter:  
name(cvar)	String variable in which to store returned name. 
The variable name must begin with a '$' 
character or be defined as string data type. The 
returned code will be a null terminated array of 
characters.


System Variables Set:
@ERROR(ivar)	Error code:
	0 = No error
	1 = Type does not exist


INQTCODE
INQTCODE  XE "copious commands:retrieve type code"  XE 
"INQTCODE " returns the type code of a copious entity type given its 
name.


Format:
INQTCODE name, tcode


Input Parameter:  
name(cval)	String variable in which to store returned name. 
The variable name must begin with a '$' 
character or be defined as string data type. The 
returned code will be a null terminated array of 
characters.


Output Parameter:  
tcode (ival)  	Entity type code


System Variables Set:
@ERROR(ivar)	Error code:
	0 = No error
	1 = Type does not exist

LABEL
A LABEL  XE "detail entities:label"  XE "primitives:LABEL "  XE "LABEL 
" primitive describes the geometry and text found in a CADKEY label 
dimension entity. 

When a LABEL primitive is read from a CADL file, a label entity is 
created in the CADKEY database in the specified view.

When a label entity is written to a CADL file as a LABEL primitive, a 
VIEW primitive is created first (if necessary) which the LABEL primitive 
may reference as its definition plane.


Format:
LABEL	x1, y1, x2, y2, x3, y3, arrowtype, x, y, str, rot, ht, asp, [vnum], 
[col], [lev], [fnt], [grpnum], [subgrp], [pen], [slnt], [fill], [uln]


Input Parameters:
x1 (double) 	X value of leader 1's first endpoint in label's 
view coordinates

y1 (double) 	Y value of leader 1's first endpoint in label's 
view coordinates

x2 (double) 	X value of leader 1's second endpoint and the 
first endpoint of leader 2 in label's view 
coordinates

y2 (double)	Y value of leader 1's second endpoint and the 
first endpoint of leader 2 in label's view 
coordinate

x3 (double) 	X value of leader 2's second endpoint in label's 
view coordinates

y3 (double) 	Y value of leader 2's second endpoint in label's 
view coordinates 

arrowtype (integer)	Arrowhead type:
	0 = Style 1
	1 = Style 2
	(The endpoint of leader 2 intersects with the 
arrowhead tip.)

x (double)	X value of the lower left corner of the first line of 
the text string in text's view coordinates

y (double)	Y value of the lower left corner of the first line of 
the text string in text's view coordinates

str (string) 	A character string. 

rot (double) 	The rotation angle of the text about the XY 
coordinate (in degrees)
	rot must be >= 0 and <= 360 degrees

ht (double)	The character height in system world units

asp (double)	The text aspect ratio (width/height)

vnum (integer) 		VIEW primitive reference number. The VIEW 
primitive referenced must precede this primitive 
or an error message is displayed and the 
program terminates.

col (integer) 	The color assigned to the note entity
	0-15 = Number in the system color palette

lev (integer) 	Level number assigned to the note entity
	1-256 = System level number
	0 = Current system level number

fnt (integer)	Text font number assigned to the note entity:
	-16 through -1 = font number (new style)
	0 = Current system font number
	1 = Bold
	2 = Slant
	3 = Bold box filled
	4 = Bold slant filled
	5 = Bold box
	6 = Bold slant

grpnum (integer) 	Group reference number
	1-127 = Group number
	0 = No group assignment

subgrp (integer)  	Subgroup reference number
	1-256 = Subgroup number
	0 = No subgroup assignment

Note : If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero(0), both of them will be ignored.

pen (integer)	Pen number
	1-8 = Pen number
	0 = Use current system pen number

slnt (integer)	Text slant angle (new font style only)
	slnt must be >= -31 and <= 31 degrees

fill (integer)	Fill mode (new font style only)
	0 = Non-filled text
	1 = Filled text

uln (integer)	Underline mode
	0 = Non-underlined text
	1 = Underlined text


LEADER
A LEADER XE "detail entities:leader line"   XE "primitives:LEADER "  XE 
"LEADER" primitive describes the geometry found in a CADKEY leader 
dimension entity.

When a LEADER primitive is read from a CADL file, a leader entity is 
created in the CADKEY database in the specified view.

When a leader entity is written to a CADL file as a LEADER primitive, a 
VIEW primitive is created first (if necessary) which the LEADER 
primitive may reference as its definition plane.


Format:
LEADER  x1, y1, x2, y2, arrowsize, arrowtype, [vnum], [col], [lev], 
[ltype], [grpnum], [subgrp], [pen]


Input Parameters:
x1 (double)	X value of endpoint 1 in leader's view 
coordinates

y1 (double)	Y value of endpoint 1 in leader's view 
coordinates

x2 (double) 	X value of endpoint 2 in leader's view 
coordinates

y2 (double) 	Y value of endpoint 2 in leader's view 
coordinates

arrowsize (double) 	Size of arrowhead

arrowtype (integer) 	Arrowhead type:
	0 = Style 1
	1 = Style 2

vnum (integer) 	VIEW primitive reference number. The VIEW 
primitive referenced must precede this primitive 
or an error message is displayed and the 
program terminates.
	0 = Use current system view in effect

col (integer) 	Color number
	0-15 = Number in the system color palette

lev (integer) 	Level number
	1-256 = System level number
	0 = Use current system level

ltype (integer) 	Line type:
	1 = Solid
	2 = Dashed
	3 = Center line
	4 = Phantom line
	0 = Use current system line type

grpnum (integer) 	Group reference number
	1-127 = Group number
	0 = No group assignment

subgrp (integer)   	Subgroup reference number
	1-256 = Subgroup number
	0 = No subgroup assignment

Note : If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero(0), both of them will be ignored.

pen (integer)	Pen number
	1-8 = Pen number
	0 = Use current system pen number


LEVELS
LEVELS  XE "LEVELS " changes the levels displayed by adding or 
removing designated levels. An automatic redraw is not performed with 
this command. The format is as follows: 


Format:
LEVELS opt, lowlev, [highlev]

Input Parameters:
opt (integer) 	Option flag: 
	0 = Turns off a level
	1 = Turns on a level
lowlev (integer) 	Low level in range of system levels to turn 
on/off. 
	lowlev must be >= 1 and <= 256 
 
highlev (integer) 	High level in range of system levels to turn 
on/off. When this parameter is not used, it is 
assumed that only one level (lowlev) is to be 
turned on/off. 
	highlev must be >lowlev and <= 256 
 

LINDIM
The LINDIM  XE "detail entities:line dimension"  XE "primitives:LINDIM 
"  XE "LINDIM " primitive describes a linear dimension entity. All 
LINDIM data is represented in local view coordinates.

When a LINDIM primitive is read from a CADL file, a linear dimension 
entity is created in the database. 

When a linear dimension entity is written to a CADL file as a LINDIM 
primitive, a VIEW primitive is created first. In addition to a VIEW 
primitive, some arrays are created for the LINDIM definition.

When a LINDIM primitive is read from a CADL file, all the arrays 
except refln are optional. LINDIM requires one reference line. From the 
length of the reference line and the value of 'form', a dimension value is 
computed. If a special value/string is desired in place of the numeric 
value of the angle then the string should replace the parameter 'str'.


Format:
LINDIM	 x, y, z, str, refln, axis, form, [txtinfo], [diminfo1], [diminfo2], 
[txtatt], [entatt]


Input Parameters:
x (double) 	X value of the text position based on the 
alignment defined in the TXTINFO array

y (double)	Y value of the text position based on the 
alignment defined in the TXTINFO array

z (double)	Z value of the text position based on the 
alignment defined in the TXTINFO array

str (string)	A character string. If it is omitted, the dimension 
value is calculated and displayed.

refln (farray)	Array of floats that defines the coordinates of 
the reference lines. Each LINDIM requires one 
reference line. For more detail refer to the 
System Arrays section.

axis (double)	Angle of dimension axis (in radians)

form (integer)	Linear dimension form:
	1 = Horizontal linear dimension
	2 = Vertical linear dimension
	3 = Parallel linear dimension
	4 = Horizontal Radial edge (radius of arc/circle 
dimensioned horizontally)
	5 = Vertical Radial edge (radius of arc/circle 
dimensioned vertically)
	6 = Parallel Radial edge (radius of arc/circle 
dimensioned parallel to an edge)
	7 = Horizontal Diametral edge (diameter of 
arc/circle dimensioned horizontally)
	8 = Vertical Diametral edge (diameter of 
arc/circle dimensioned vertically)
	9 = Parallel Diametral edge (diameter of 
arc/circle dimensioned parallel to an edge)
	10 = Chamfer angle
	11 = Chamfer angle at 45 degrees.

txtinfo(iarray)	An array of integer values that describes the 
information for the dimension text. The array is 
not required if the value of 'str' is NULL. For 
more detail refer to the System Arrays section.

diminfo1(iarray)	An array of integer values that is used for the 
dimension. For more detail refer to the System 
Arrays section.

diminfo2(farray)	An array of floats that is used for the dimension. 
For more detail refer to the System Arrays 
section.

txtatt(farray) 	An array of floats that describes the attributes of 
the dimension text. The array is not required if 
the value of 'str' is NULL. For more detail refer 
to the System Arrays section.

entatt(iarray) 	An array of integer values that describes the 
attributes of the entity.  For more detail refer to 
the System Arrays section.


LINE
The LINE  XE "primitives:LINE "   XE "LINE " primitive describes the 
two endpoints of a line in X, Y, Z world coordinates (model space), 
whose length must be greater than or equal to 0.0005, and less than or 
equal to 10,000.  When a LINE primitive is read from a CADL file, a line 
entity is added in the database.

When a line entity is written to a CADL file, it is output as a LINE 
primitive.


Format:
LINE x1, y1, z1, x2, y2, z2, [col], [lev], [ltype], [grpnum], [subgrp], [pen], 
[lwdt]


Input Parameters:
x1 (double) 	X value of line endpoint 1 in world coordinates

y1 (double)	Y value of line endpoint 1 in world coordinates

z1 (double) 	Z value of line endpoint 1 in world coordinates

x2 (double) 	X value of line endpoint 2 in world coordinates

y2 (double)	Y value of line endpoint 2 in world coordinates

z2 (double)	Z value of line endpoint 2 in world coordinates

col (integer)	Color
	0-15 = Number in the system color palette

lev (integer)	Level number
	1-256 = System level number
	0 = Use current system level 

ltype (integer)	Line type:
	1 = Solid
	2 = Dashed
	3 = Center Line
	4 = Phantom line
	0 = Use current system line type

grpnum (integer) 	Group reference number
	1-127 = Group number
	0 = No group assignment

subgrp (integer)	Subgroup reference number
	1-256 = Subgroup number
	0 = No subgroup assignment

Note : If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero(0), both of them will be ignored.

pen (integer)	Pen number
	1-8 = Pen number
	0 = Use current system pen number

lwdt (integer)	Line width
	1-15 = Odd line width
	0 = Use current system line width


MAKECOLL
 XE "MAKECOLL"  XE "collectives:creation" Make collective from a list 
of entity ID's.  When the range is specified, the ID list must contain 2 ID's 
-a minimum and a maximum - which identify a range of entities to be 
made into a collective.


Format:
MAKECOLL num, id


Input Parameters:
num (integer)	Number of entities to put into collective 
	-1 = flag that indicates that there are 2 IDs in the 
list that represent range.

id[] (ID)	List of entity IDs


MODE
MODE  XE "MODE " allows the operational mode for CADL file 
execution to be set, with regard to the recognition of data primitives. 
Three keyword modes are available: NORMAL, DRAW, and SUPPRESS. 


Format:
MODE keyword


Input Parameter:
keyword (word)  	One of the following modes:

	NORMAL - displays primitives found in a CADL 
file on the screen and adds them to the database.

	DRAW - displays primitives on the screen (if 
possible) but DOES NOT add them to the 
database.

	SUPPRESS - adds primitives to the data base but 
DOES NOT display them on the screen.


NEXTCOLL
 XE "NEXTCOLL"  XE "collectives:entity selection" Get next entity in a 
collective.


Format:
NEXTCOLL num, etype, id


Input Parameters:
num (integer)	Entity  number
	-32767 = flag that indicates retrieve the next 
entity in the collective entity


Output Parameters:
etype (integer)	Type of the entity returned

id (ID)	ID of the returned entity


System Variables Set:
@ERROR	Error code:
	 0	= No error
	-5	= No more entities or entity number out 
of range
	-6	= Not enough memory for entity 
extraction


NFNOTE
The NFNOTE  XE "detail entities:file note"  XE "primitives:NFNOTE 
"  XE "NFNOTE " primitive is similar to the NNOTE primitive except 
that the characters are strings defined in a file instead of included as 
part of the statement. When an NFNOTE primitive is read from a CADL 
file, a disk note entity is created in the database.

When an NFNOTE entity is written to a CADL file as an NFNOTE 
primitive, a VIEW primitive is created first. In addition to a VIEW 
primitive, some arrays are created. These arrays are used for the 
NFNOTE definition.


Format:
NFNOTE x, y,  z, fname, [txtinfo], [txtatt], [entatt] 
Input Parameters:
x (double) 	X value of the lower left corner of the first line of 
text string in text's view coordinates

y (double)	Y value of the lower left corner of the first line of 
text string in text's view coordinates

z (double)	Z value of the lower left corner of the first line of 
text string in text's view coordinates

fname (word) 	Text file specification. Processing of the file 
specification is as follows: 1) if the specification 
does not include a path, the directory used is the 
default directory for CADL programs (set with 
the CONFIG program);  2) if a full path is 
included, the full path is used; 3) if the 
specification includes a relative path, the 
specified directory is relative to the current 
working directory.

txtinfo(iarray)	An array of integer values that describes the 
information for the dimension text. For more 
detail refer to the System Arrays section.

txtatt(farray) 	An array of floats that describes the attributes of 
the dimension text. For more detail refer to the 
System Arrays section.

entatt(iarray) 	An array of integer values that describes the 
attributes of the entity.  For more detail refer to 
the System Arrays section.


NLABEL
An NLABEL  XE "detail entities:label"  XE "primitives:NLABEL "  XE 
"NLABEL " primitive describes the geometry and text found in a 
CADKEY label dimension entity. All NLABEL data is represented in 
local view coordinates.

When an NLABEL primitive is read from a CADL file, a label dimension 
entity is created in the database. 

When a label entity is written to a CADL file as an NLABEL primitive, a 
VIEW primitive is created first. In addition to a VIEW primitive, some 
arrays are created. These arrays are used for the NLABEL definition.

When an NLABEL primitive is read from a CADL file, all the arrays 
except witln and ldrln are optional. NLABEL requires one witness line 
and at least one leader line. The system allows as many as five leader 
lines for every label entity. The string should be placed in the variable 
'str'.
Format:
NLABEL x, y, z, str, numwit, witln, numldr, ldrln, [txtinfo], [txtatt], 
[entatt]


Input Parameters:
x (double) 	X value of the lower left corner of the label text 
in the view coordinates

y (double)	Y value of the lower left corner of the label text 
in the view coordinates

z (double)	Z value of the lower left corner of the label text 
in the view coordinates

str (string)	A character string. 

numwit(integer)	Number of witness lines

witln(farray)	Array of floats that defines the coordinates of 
the witness line. Each NLABEL requires 1 
witness line. For more detail refer to the System 
Arrays section.

numldr	Number of leader lines

ldrln(farray)	Array of floats that defines the coordinates of 
the leader lines. Each NLABEL requires 1 leader 
line. A label allows as many as 5 leaders. For 
more detail refer to the System Arrays section.

txtinfo(iarray) 	An array of integer values that describes the 
information for the label text. For more detail 
refer to the System Arrays section.

txtatt(farray) 	An array of floats that describes the attributes of 
the dimension text. For more detail refer to the 
System Arrays section.

entatt(iarray) 	An array of integer values that describes the 
attributes of the entity.  For more detail refer to 
the System Arrays section.


NLEADER
An NLEADER  XE "detail entities:leader line"  XE "primitives:NLEADER 
"  XE "NLEADER " primitive describes the geometry found in a CADKEY 
leader dimension entity. All NLEADER data is represented in local view 
coordinates.

When a leader entity is written to a CADL file as an NLEADER 
primitive, a VIEW primitive is created first. In addition to a VIEW 
primitive, some arrays are created for the NLEADER definition.
When an NLEADER primitive is read from a CADL file, all the arrays 
except ldrln are optional. A leader contains one leader line. 


Format:
LEADER ldrln, depth, vwonly, [entatt]


Input Parameters:
ldrln(farray)	Array of floats that defines the coordinates of 
the leader line. Each NLEADER requires 1 leader 
line. For more detail refer to the System Arrays 
section.

depth(double)	Depth in view of definition.

vwonly(integer)   	A flag to indicate if the leader is displayed only 
in the view of definition or can be seen in other 
views.
	0 = Display in all views
	1 = Display only in view of definition

entatt(iarray) 	An array of integer values that describes the 
attributes of the entity. For more detail refer to 
the System Arrays section.



NNOTE
An NNOTE  XE "detail entities:note"  XE "primitives:NNOTE "  XE 
"NNOTE " primitive describes the geometry found in a CADKEY note 
entity. All NNOTE data is represented in local view coordinates.

When an NNOTE primitive is read from a CADL file, a note entity is 
created in the database. 

When a note entity is written to a CADL file as an NNOTE primitive, a 
VIEW primitive is created first. In addition to a VIEW primitive, some 
arrays are created for the NNOTE definition.


Format:
NNOTE x, y, z, str, [txtinfo], [txtatt], [entatt]


Input Parameters:
x (double) 	X value of the lower left corner of the text in the 
view coordinates

y (double)	Y value of the lower left corner of the  text in the 
view coordinates

z (double)	Z value of the lower left corner of the  text in the 
view coordinates

str (string)	A character string.  

txtinfo(iarray)	An array of integer values that describes the 
information for the label text. For more detail 
refer to the System Arrays section.

txtatt(farray)	An array of floats that describes the attributes of 
the dimension text. For more detail refer to the 
System Arrays section.

entatt(iarray)	An array of integer values that describes the 
attributes of the entity.  For more detail refer to 
the System Arrays section.


NOTE
The NOTE  XE "detail entities:note"  XE "primitives:NOTE "  XE "NOTE 
" primitive describes one or more strings of characters assigned to a 
specified view plane.  When a NOTE primitive is read from a CADL file, 
a note entity is created in the database.

When a note entity is written to a CADL file, a VIEW primitive is created 
first (if necessary) which the NOTE primitive may reference as its 
assigned plane.


Format:
NOTE 	x, y, str, [rot], [ht], [asp], [vnum], [col], [lev], [fnt], [grpnum], 
[subgrp], [pen], [slnt], [fill], [lnsp], [uln], [mir]


Input Parameters:
x (double)	X value of the lower left corner of the first line of 
the text string in text's view coordinates

y (double)	Y value of the lower left corner of the first line of 
the text string in text's view coordinates

str (string)	A character string.

rot (double)	The rotation angle of the text about the XY 
coordinate (in degrees)
	rot must be >= 0 and <= 360 degrees

ht (double) 	The character height in system world units

asp (double)	The text aspect ratio (width/height)

vnum (integer) 	VIEW primitive reference number. The VIEW 
primitive referenced must precede this primitive 
or an error message is displayed and the 
program terminates.
	0 = Use current system view in effect

col (integer)	The color assigned to the note entity
	0-15 = Number in the system color palette

lev (integer)	Level number assigned to the note entity
	1-256 = System level number
	0 = Current system level number

fnt (integer)	Text font number assigned to the note entity:
	-16 through -1 = Font number (new style)
	0 = Current system font number
	1 = Bold
	2 = Slant
	3 = Bold box filled
	4 = Bold slant filled
	5 = Bold box
	6 = Bold slant

grpnum (integer) 	Group reference number
	1-127 = Group number
	0 = No group assignment

subgrp (integer)  	Subgroup reference number
	1-256 = Subgroup number
	0 = No subgroup assignment

Note: If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero(0), both of them will be ignored.

pen (integer)	Pen number
	1-8 = Pen number
	0 = Use current system pen number

slnt (integer)	Text slant angle (new font style only)
	slnt must be >= -31 and <= 31 degrees

fill (integer)	Fill mode (new font style only)
	0 = Nonfilled text
	1 = Filled text

lnsp (double)	Line spacing factor. This factor times the 
character height equals the 
	distance between lines of text.

uln (integer)	Underline mode
	0 = Nonunderlined text
	1 = Underlined text

mir (integer)	Mirror mode
	0 = Nonmirrored text
	1 = Mirrored text



NWITNESS
An NWITNESS  XE "detail entities:witness line"  XE 
"primitives:NWITNESS "  XE "NWITNESS " primitive describes the 
geometry found in a CADKEY witness dimension entity. All NWITNESS 
data is represented in local view coordinates.

When an NWITNESS primitive is read from a CADL file, a witness 
dimension entity is created in the database. 

When a witness entity is written to a CADL file as an NWITNESS 
primitive, a VIEW primitive is created first. In addition to a VIEW 
primitive, some arrays are created for the NWITNESS definition.

When an NWITNESS primitive is read from a CADL file, all of the 
arrays except witln are optional. 


Format:
NWITNESS witln, depth, vwonly, [entatt]


Input Parameters:
witln(farray)	Array of floats that defines the coordinates of 
the witness line. Each NWITNESS requires one 
witness line. For more detail refer to the System 
Arrays section.

depth(double)	Depth in view of definition.

vwonly(integer)   	A flag to indicate if the witness line is displayed 
only in the view of definition or can be seen in 
other views.
	0 = Display in all views
	1 = Display only in view of definition

entatt(iarray) 	An array of integer values that describes the 
attributes of the entity.  For more detail refer to 
the System Arrays section.

ON GOTO
ON GOTO XE "program control statements:ON GOTO"  XE "ON GOTO"  
provides a multiple branch based on a computed value. A computed 
negative or zero value goes to the first label specified. Values of 1, 2, 3, 
etc., go to the second, third, fourth, etc. labels, respectively. Any positive 
value for which there is no label goes to the last label in the list (even if 
it's the first and only label). Any value that matches a "null" label (e.g., 
label1, label3) "drops through" and executes the statement following the 
ON GOTO. 

Format:
ON value GOTO [lab1, ...] 


ORDALIGN
ORDALIGN  XE "entity control:ordinate alignment"  XE "ORDALIGN 
" allows you to align the given ordinate dimension entity. An ordinate 
dimension is a collective entity and therefore, the ID of only one of many 
ordinates needs to be passed. The system will align the ordinate 
dimension automatically.
 

Format:
ORDALIGN id

Input Parameter:
id (ulong)	Unique ID of the ordinate or the current entity 
selected


ORDDIM
The ORDDIM  XE "detail entities:ordinate dimension"  XE 
"primitives:ORDDIM "  XE "ORDDIM " primitive describes an ordinate 
dimension entity. All ORDDIM data is represented in local view 
coordinates.

When an ORDDIM primitive is read from a CADL file, an ordinate 
dimension is created in the database.  An ordinate dimension entity is a 
collective entity. It is collection of individual ordinate dimensions. 

When an ordinate dimension is written to a CADL file as a ORDDIM 
primitive, a VIEW primitive is created first. In addition to a VIEW 
primitive, some arrays are created for the ORDDIM definition. An 
ordinate dimension entity is a collective of many ordinate dimensions. 
When it is written to a CADL file, a "SET collective, 1" command is 
issued along with "SET collective, 0" at the end. An ORDALIGN 
command is also written at the end. This command aligns the ordinate 
dimension entity with respect to the base point.

When an ORDDIM primitive is read from a CADL file, all the arrays 
except refpnt are optional. Three points are required to be defined for 
each ordinate dimension. These points are defined in the refpnt array.  
The system uses these points to calculate the dimension value. If a 
special value/string is desired in place of the numeric value of the 
ordinate dimension then the string should replace the parameter 'str'.


Format:
ORDDIM	x, y, z, str, refpnt, axis, form, [txtinfo], [diminfo1], [diminfo2], 
[txtatt], [entatt]

Input Parameters:
x (double) 	X value of the text position based on the 
alignment defined in the TXTINFO array

y (double)	Y value of the text position based on the 
alignment defined in the TXTINFO array

z (double)	Z value of the text position based on the 
alignment defined in the TXTINFO array

str (string)	A character string. If it is NULL, the dimension 
value is calculated and displayed.

refpnt(farray)	Array of float data that defines the coordinates 
of the reference point. Each  ORDDIM requires 3 
reference points. The order of the points is as 
follows:
	1.  Base ordinate dimension point
	2.  Base ordinate dimension text point
	3.  Subordinate dimension point
	For more detail refer to the System Arrays 
section.

axis(double)	Angle of dimension axis (in degrees)

form (integer)	Ordinate dimension form:
	1 = Horizontal ordinate dimension
	2 = Vertical ordinate dimension
	3 = Parallel ordinate dimension
		
txtinfo(iarray)	An array of integer values that describes the 
information for the dimension text. The array is 
not required if the value of 'str' is NULL. For 
more detail refer to the System Arrays section.

diminfo1(iarray)	An array of integer values that is used for the 
dimension. For more detail refer to the System 
Arrays section.

diminfo2(farray)	An array of floats that is used for the dimension. 
For more detail refer to the System Arrays 
section.

txtatt(farray)	An array of floats that describes the attributes of 
the dimension text. The array is not required if 
the value of 'str' is NULL. For more detail refer 
to the System Arrays section.

entatt(iarray)	An array of integer values that describes the 
attributes of the entity.  For more detail refer to 
the System Arrays section.


PALETTE
PALETTE  XE "PALETTE " provides means of setting one or more colors 
in the CADKEY color graphics palette. Each color defined is a 
combination of red, green, and blue intensities. The values range 
between 0 and 1, where 0.0 is off and 1.0 is full intensity. Note the effects 
that this command has on the system.


Graphics Display:
1) If a 256-color graphics device is being used, the graphics color is set at 
the hardware device level and affects the display of all graphic entities 
and the screen background color (if color 0 is set). Refer to the 
Hardware Setup Guide for a listing of the 256-color graphics devices 
supported by CADKEY.

2) If a 16-color graphics device is being used, the appropriate color 
dither patterns are chosen by the system to simulate colors, affecting 
only the display of filled polygons and polylines.  
	
3) If a monochrome graphics device is being used, the appropriate black 
and white dither patterns are chosen by the system to simulate colors, 
affecting only the display of filled polygons and filled polylines.	


On-Line Printing:
1) If a color printer is being used, the appropriate color dither patterns 
are chosen by the system to simulate colors affecting only the display 
of filled polygons, filled polylines and the background color (if color 0 
is set). If colors 1-15 have been redefined (replacing the system 
defaults), the printing of entities other than filled polygons and filled 
polylines will be performed such that the closest printer base color will 
be chosen.

2) If a black and white printer is being used, the appropriate black and 
white color dither patterns are used to simulate colors, affecting only 
the display of filled polygons, filled polylines and the background color 
(if color 0 is set).


Format:
PALETTE start, numcol, arrayname 


Input Parameters: 
start (ival)	CADKEY starting color index (0-255) 

numcol (ival)	Number of colors to set 

arrayname (word)	Two-dimensional array containing color values. 
The array is declared as 3 x n where n is the 
number of color indices. A color value is always 
expressed as a real number between 0 and 1, 
where 0 is no saturation and 1 is full saturation. 

For index 'i' in array "rgb", rgb[0][i] is the red value, rgb[1][i] is 
the green, and rgb[2][i] is the blue. 


PAUSE
PAUSE  XE "PAUSE " displays a text string on the CADKEY prompt line 
and waits for the user to press <Enter>, BACKUP, or ESCAPE before 
continuing. The text displayed may either be a default message (if 
PAUSE has no parameters) or user-defined text. The default message 
appears as follows:

Press RETURN to continue

To define PAUSE text, the format control string, along with any required 
value parameters, must be supplied. The format string is processed in 
the same manner as the PRINT statement (i.e., values are converted as 
per field specifiers) even though output is to the prompt line. The total 
length of the text string, including the expanded variables in the string, 
must not exceed 68 characters or truncation will occur. 
 

Format:
PAUSE [ format, val1, ...] 
 

Input Parameters: 
format (string)  	Format control string 
 
val1 (val)  	First value to output based on first field specifier 
 
System Variables Set: 
@KEY (ivar)  	Code for last key hit: 
	-3 = ESC
	-2 = F10
	-1 = CR (<Enter>)
 

POINT
The POINT  XE "primitives:POINT "  XE "POINT " primitive describes an 
X, Y, Z location in world coordinates (model space).

When a POINT primitive is read from a CADL file, a point entity is 
created in the system database.

When a point entity is written to a CADL file, a POINT primitive is 
produced.


Format:
POINT x, y, z, [col], [lev], [grpnum], [subgrp], [pen]


Input Parameters:
x (double)	X value of point in world coordinates
y (double)	Y value of point in world coordinates

z (double)	Z value of point in world coordinates

col (integer)	Color 
	0-15 = Number in the system color palette
		
lev (integer)	Level number
	1-256 = System level number
	0 = Use current system level 

grpnum (integer) 	Group reference number
	1-127 = Group number
	0 = No group assignment

subgrp (integer)	Subgroup reference number
	1-256 = Subgroup number
	0 = No subgroup assignment

Note : If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero (0), both of them will be ignored.

pen (integer)	Pen number
	1-8 = Pen number 
	0 = Use current system pen number 


POLYGON
A POLYGON  XE "primitives:POLYGON "  XE "POLYGON " primitive 
describes a polygon of up to eight vertices. Although a polygon is 
normally thought of as a planar figure, there is no restriction that the 
vertices must lie in a plane.

When a POLYGON primitive is read from a CADL file, this primitive is 
stored in the system's database as a polygon entity.

When a polygon entity is written to a CADL file, it is output as a 
POLYGON primitive.


Format:
POLYGON filltype, fillcol, numpts, arrayname, [col], [lev], [ltype], 
[grpnum], [subgrp], [pen]

Input Parameters:
filltype (integer)	Fill type
	1 = Unfilled
	2 = Filled

fillcol (integer)	Color of polygon if filled.  Otherwise, color of 
outline is specified by the col parameter. The 
range of fcol is from 0-255

numpts (integer)	Number of points in polygon (n>=3 and <=8)  
		
arrayname (word)	Name of one-dimensional data array containing 
polygon data as follows:
	arrayname 	[0] = x (first point in world 
coordinates)
		    	[1] = y      
		    	[2] = z
			..
			..
	     		[(n-1)*3]	= x  (last point in 
world coordinates)
	     		[(n-1)*3+1]	= y   
	     		[(n-1)*3+2]	= z

First and last point need not be identical to force closure; closure is 
automatic.

col (integer)	Color
	0-15 = Number in the system color palette
	
lev (integer)	Level number
	1-256 = System level number
	0 = Use current system level 

ltype (integer)	Line type:
	1 = Solid
	2 = Dashed
	3 = Center line
	4 = Phantom line
	0 = Use current system line type 

grpnum (integer)	Group reference number
	1-127 = Group number
	0 = No group assignment

subgrp (integer)	Subgroup reference number
	1-256 = Subgroup number
	0 = No subgroup assignment

Note : If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero(0), both of them will be ignored.

pen (integer)	Pen number
	1-8 = Pen number
	0 = Use current system pen number 


POLYLINE
A POLYLINE  XE "primitives:POLYLINE "  XE "POLYLINE " primitive 
describes a polyline made up of up to 837 points. Although a polyline is 
normally
thought of as a planar figure, there is no restriction that the vertices 
must lie in a plane.

When a POLYLINE primitive is read from a CADL file, this primitive is 
stored in the system's database as a polyline entity.

When a polyline entity is written to a CADL file, it is output as a 
POLYLINE primitive.


Format:
POLYLINE numpts, arrayname, width, pstyle, dstyle, fstyle, [col], [lev], 
[ltype], [grpnum], [subgrp], [pen], [lwdt]


Input Parameters:
numpts (integer)	Number of points in polyline (must be at least 
two)

arrayname (word) 	Name of one-dimensional data array containing 
polyline data as follows:
	arrayname	[0] = x  (first point in world 
coordinates)
			[1] = y      
			[2] = z
			..
	     		[(n-1)*3]     = x  (last point in 
world coordinates)
	     		[(n-1)*3+1] = y   
	    		[(n-1)*3+2] = z

width (double)	Line width in CADKEY units (applies to dstyles 
2, 3, and 4 only). A zero line width results in a 
centerline.

pstyle (integer)	Polyline style:
	1 = Open polyline
	2 = Closed polyline
	3 = Filled polyline

dstyle (integer)	Display style:
	1 = Centerline
	2 = Line at width using rounded corners
	3 = Line at width using sharp corners
	4 = Tool path
fstyle (integer)	Fill style (dstyles 2 and 3 only)
	1 = No fill (outline)
	2 = Solid filled

col (integer)	Color
	0-15 = Number in the system color palette
	
lev (integer)	Level number
	1-256 = System level number
	0 = Use current system level

ltype (integer)	Line type:
	1 = Solid
	2 = Dashed
	3 = Center line
	4 = Phantom line
	0 = Use current system line type 

grpnum (integer)	Group reference number
	1-127 = Group number
	0 = No group assignment

subgrp (integer)   	Subgroup reference number
	1-256 = Subgroup number
	0 = No subgroup assignment

Note : If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero(0), both of them will be ignored.

pen (integer)	Pen number
	1-8 = Pen number
	0 = Use current system pen number 

lwdt (integer)	Line width
	1-15 = Odd line width
	0 = Use current system line width


PRANGE
PRANGE  XE "PRANGE " allows a range of colors in the CADKEY 
graphics palette to be set such that a linear blend is chosen between the 
start and end RGB values specified. Refer to the PALETTE command for 
information on how the usage of this command affects the system.


Format:
PRANGE startpal, numcolors, startred, startgreen, startblue, endred, 
endgreen, endblue


Input Parameters:
startpal (ival)	Starting index in palette for range of colors to set 
(>= 0 and <= 255)
		
numcolors (ival)  	Number of colors in range to set (>= 0 and <= 
256-startpal)

startred (fval)  	Starting red value in range to set (>= 0.0 and <= 
1.0)

startgreen (fval)  	Starting green value in range to set (>= 0.0 and 
<= 1.0)

startblue (fval)  	Starting blue value in range to set (>= 0.0 and <= 
1.0)

endred (fval)  	Ending red value in range to set (>= 0.0 and <= 
1.0)

endgreen (fval)  	Ending green value in range to set (>= 0.0 and 
<= 1.0)

endblue (fval)  	Ending blue value in range to set (>= 0.0 and <= 
1.0)


System Variables Set:
@palr[] 	Red palette values

@palg[] 	Green palette values

@palb[] 	Blue palette values


PRINT
PRINT  XE "PRINT " allows the user to write characters, integers, and 
floating point numbers to the current standard output device in a 
variety of ways through the use of a format string. PRINT is a more 
flexible alternative to the WRITE statement.  
 
The format string contains any number of field specifiers, used to 
describe how values should be converted and written to the output 
device. For each specifier, a value is parsed from the statement and 
written out accordingly. If there is no matching value for a format 
specification or there is an error in its evaluation, the characters "???" 
are output in lieu of the value. Unlike the WRITE statement, only one 
element of an array can be output at a time. Refer to the Introduction 
section of this CADL guide for a description of field specifiers. 

The device through which output is written is the standard output 
device. At each CADL invocation, the output device is usually the 
system console (as with CADKEY). However, if the output redirection 
symbol (>) is used when CADKEY is initiated, the output device will be 
the redirection name (see the system's manual for more information on 
input/output redirection). The output device can be changed at any time 
to another device or to a file by using the SET DEVOUT command. The 
new device or file will be in effect until  CADL processing is completed, 
another SET DEVOUT is processed, or a CLOSE DEVOUT command is 
processed. 
 

Format:
PRINT format [, val1, ...] 
 

Input Parameters: 
format (string)  	Format control string 
 
val1 (val)  	First value to output based on first field specifier 
 


System Variables Set: 
@ERROR (ivar)	Error code: 
	0 = No error
	1 = DEVOUT not open
 

PROMPT
PROMPT  XE "PROMPT " displays a text string on the CADKEY prompt 
line but does not pause for user input. A format control string must be 
supplied; additional value parameters are optional.  The resulting text 
string must not exceed 68 characters or truncation will occur. 
 

Format:
PROMPT format [, val1, ...] 
 

Input Parameters: 
format (string)  	Format control string 
 
val1 (val)  	First value to output based on first field specifier 
 

READ
READ  XE "READ " causes data to be read from an ASCII file and set into 
specified variables. The data file consists of numeric values separated by 
commas. White space, Carriage Returns, and Line Feeds (new lines) may 
optionally be inserted before or after the numbers. For each variable 
specified, a number is extracted from the data file. This continues until 
either all variables are processed or the end of the data file is reached. At 
the completion of READ processing, the system variable, @NREAD, 
contains the number of variables set. 
 
Processing of the file specification is as follows: 

1) 	If the specification does not include a path, the directory used 
is the default directory for CADL programs (set with the 
CONFIG program).
2) 	If a full path is included, the specified directory is used.
3) 	If the specification includes a relative path, the specified 
directory is relative to the current working directory.

The READ command supports two read modes: 

	0 - Read from the beginning of the file
	1 - Read from the current position

For open mode 1, a file is considered currently opened only if a previous 
READ (or WRITE involving the same data file) has been processed 
within the same CADL execution. This is because all data files are closed 
when processing of a CADL file (or files if CHAINed or DOSUBed) is 
complete.
	

Format:
READ fname, mode, var1 [, var2, ...]


Input Parameters: 
fname (string)  	Data file specification 
 
mode (ival)  	Open mode: 
0  =	Read from beginning of file. 
1  =	Read from current file position (if currently 
opened), otherwise, start from the beginning. 
 

Output Parameters: 
var1 (var)  	Name of first variable 

var2 (var)  	Name of second variable 
 

System Variables Set: 
@ERROR (ivar) 	Error code:
	0 = No error
	1 = Can't open data file

@NREAD (ivar)	Number of data items read


READDEV
READDEV  XE "READDEV " reads the CADL digitizing device for a 
coordinate position, optionally waiting for a function button to be 
pressed. Coordinates are either two- or three-dimensional and are 
returned in x, y, and z. Additional information may also be returned via 
a, b and c. The number of dimensions and the nature of any additional 
information is device dependent.


Format:
READDEV f, x, y, z, [a], [b], [c], [wflg]


Input Parameter:
wflg (ival)  	Wait flag. If set to 0, return from READDEV is 
immediate whether or not a position is available. 
If set to 1, return from READDEV occurs when 
either a function button is pressed or the 
CADKEY abort key is pressed.


Output Parameters:
f (ivar)  	Variable to store function button value

x (fvar) 	Variable to store X value

y (fvar)  	Variable to store Y value

z (fvar)	Variable to store Z value

a (fvar)  	Variable to store A value

b (fvar)  	Variable to store B value

c (fvar)  	Variable to store C value


System Variables Set:
@ERROR (ivar) 	Error code: 
	0 = No error
	1 = Can't open CADL digitizing device
	2 = Device time-out
	3 = User interrupt while waiting


REDRAW
REDRAW  XE "viewports:redraw entities"  XE "REDRAW " performs a 
redraw on the current system part displayed. This performs the same 
function as using the system's Immediate Mode command.


Format:
REDRAW [vpnum]


Input Parameter: 
vpnum (ival)  	Viewport number:
	-1 = All viewports are redrawn
	0 or default = Primary viewport redrawn
	positive number = Only designated viewport 
redrawn


System Variables Set:
@ERROR	0 = No error
	1= Invalid viewport


REM
REM  XE "program control statements:REM "  XE "REM "  XE 
"comments:in uncompiled programs" identifies remarks. This keyword, 
as well as any following text, is ignored by the system when a CADL file 
is executed.  

Format:
REM string 
 

REMCOLL
 XE "collectives:remove an entity"  XE "REMCOLL" Remove an entity 
from a collective.

Format:
REMCOLL id

Input Parameters:
id (ID)	ID of entity to remove


SCALE
SCALE  XE "scaling:setting specific scale"  XE "SCALE "  XE 
"viewports:set part scale" rescales the system part displayed. This 
performs the same function as using the system's Immediate Mode 
command, or activating the S= option in the Status Window.  
 

Format:
SCALE [scfac], [xc], [yc], [vpnum]


Input Parameters:
scfac (float)	Represents the viewing scale factor. When this 
parameter is not present, the old scale factor is 
assumed. 
	scfac must be > 0.001 and < 10,000 

xc (float)  	New X screen center. When this parameter is not 
present, the old X screen center is assumed. 
 
yc (float)  	New Y screen center. When this parameter is not 
present, the old Y screen center is assumed.

vpnum (ival) 	Viewport number:
	-1 = All viewports 
	0 or default = Primary viewport 
	positive number = Designated viewport 

System Variables Set:
@ERROR	0 = No error
	1 = Invalid viewport


SET
SET  XE "SET " allows for a number of system parameters to be set 
through CADL file execution. 


Format:
SET keyword [, val1, val2, ...]
	

Input Parameters:
keyword - represents one of the following words: 
 
arrdir
arrstyle
cdlpath
collective
collsel
color 
conaxes
const
coord
curtrack
cview
depth
devin
devout
dimfill
dimfont
dimht
dimslant
draword
dspaxes
grid
gridinc
immcom 
leader
level
levelmask
limit
linetype
linewidth
mask
maskcol
maskent
masklevel
maskltype
masklwidth
maskpen
noteang
notefill
notefont
noteht
noteline
noteslant
noteuline
notpath
pen 
pltpath
precision
prtpath
ptnpath
snap
snapinc
textasp
unit
versel
view
witness

Upper or lower case letters are accepted. 
 
Explanations of each SET command supported are detailed on the 
following pages.

SET arrdir XE "SET:ARRDIR"  XE "ARRDIR, SET" , dir	
	dir (ival) - Arrowhead direction:

0 = In
1 = Out

Sets the current arrowhead direction. This 
performs the same function as using the system's 
Immediate Mode command or choosing the 
ARR: option in the Status Window. All 
subsequently created arrows will be in the 
specified direction.

SET arrstyle XE "SET:ARRSTYLE"  XE "ARRSTYLE, SET" , style
	style (ival) - Arrowhead style (1-4)

Sets the current arrowhead style. All 
subsequently created arrows will be of the 
specified style.

SET cdlpath XE "SET:CDLPATH"  XE "CDLPATH, SET" , path	path 
(word) -  CADL directory path. 

Sets the default directory in which to find CADL 
files when CADL is invoked from the CADKEY 
menus. The use of slashes (/) or backslashes (\) 
is operating system dependent.

SET collect XE "SET:COLLECT"  XE "COLLECT, SET" , mode	mode 
(integer) - Collection mode

0 = Off
1 = On

Sets the mode of the collective flag.  When 
turned on, all subsequently created entities are 
combined into a collective.  When turned off, the 
entities are created normally.

SET collsel XE "SET:COLLSEL"  XE "COLLSEL, SET" , mode	mode 
(integer) - Collective selection mode

0 = All
1 = Single

Controls the manner in which collective entities 
are put into the selection list when selected using 
the GETENT, GETENTM, GETENTXY, and 
GETALL commands.  If set to 0, all entities in the 
collective are highlighted and the first entity in 
the collective is put into the selection list.  The 
rest of the entities in the collective cannot be 
selected through user interaction but only with 
the NEXTCOLL command.  If set to 1, only the 
selected entity is highlighted and put into the 
selection list.  The other entities in the collective 
remain selectable through user interaction. 

SET color XE "SET:COLOR"  XE "COLOR, SET" , num 		num 
(ival) - System color number. 

Defines the current system color. This performs 
the same function as using the system's 
Immediate Mode command or choosing the 
COLOR= option in the Status Window. 
 
All entities created in the system are assigned 
the current definition color. This includes all 
data primitives read in from the CADL file and 
converted to entities provided that the color 
attribute defaulted. Otherwise, the entity is 
created in the color assigned to the data 
primitive, regardless of the current definition 
color. 

SET conaxes XE "SET:CONAXES"  XE "CONAXES, SET" , mode
	mode (ival) - Display mode

0 = Off
1 = Primary viewport
2 = All viewports

Controls the display of the construction view 
axes.

SET const XE "SET:CONST"  XE "CONST, SET" , mode	mode (ival) - 
Construction mode

0 = 2D
1 = 3D

Set the construction mode to either 2D or 3D.  
This performs the same function as using the 
system's Immediate Mode command or choosing 
the CONST: option in the Status Window.

SET coord XE "SET:COORD"  XE "COORD, SET" , mode
	mode(ival) - Coordinate entry mode:

0 = View coordinates
1 = World coordinates

Sets the coordinate entry mode to either view 
coordinates or world coordinates. This performs 
the same function as using the system's 
Immediate Mode command or choosing the 
COORD: option in the Status Window.

SET curtrack XE "SET:CURTRACK"  XE "CURTRACK, SET" , mode
	mode (ival) - Tracking mode

0 = Off
1 = View coordinates
2 = World coordinates

Controls the display of cursor tracking 
coordinates. This performs the same function as 
using the system's Immediate Mode command.

SET cview XE "SET:CVIEW"  XE "CVIEW, SET" , num		num 
(ival) - System view number

This sets the construction plane to the specified 
system view number. If set to zero, the 
construction plane is always set to the currently 
active viewport's view. This performs the same 
function as using the system's Immediate Mode 
command or choosing the CPLANE= option in 
the Status Window.

SET depth XE "SET:DEPTH"  XE "DEPTH, SET" , val 		val (fval) 
- System construction depth

This sets the construction depth. This is the 
equivalent of using the Immediate Mode 
Command or cursor selecting the D= option in 
the Status Window. 
 

SET devin XE "SET:DEVIN"  XE "DEVIN, SET" , fname	fname 
(word) - Input file/device specification
 
This sets the CADL input device (which is read 
via the INPUT command) to another device or 
to a file. The new device or file will be in effect 
until either CADL processing is completed, a 
CLOSE DEVIN is processed, or another SET 
DEVIN is processed. Processing of the 
file/device specification is the same as for the 
READ command.

SET devout XE "SET:DEVOUT"  XE "DEVOUT, SET" , fname 	fname 
(word) - Output file/device specification 
 
Sets the CADL output device (which is written 
via the PRINT command) to another device or to 
a file. The new device or file will be in effect 
until either CADL processing is completed, a 
CLOSE DEVOUT command is processed,  or 
another SET DEVOUT is processed. Processing of 
the file/device specification is the same as for 
the READ command.

SET dimfill XE "SET:DIMFILL"  XE "DIMFILL, SET" , mode	mode 
(ival) - Fill mode

0 = No fill
1 = Fill

Sets the current dimension text fill mode. All 
subsequently created dimensions will have this 
fill mode.

SET dimfont XE "SET:DIMFONT"  XE "DIMFILL, SET" , font	font 
(ival) - System font number (1-6, -1 through -16)

Sets the current dimension text font. This 
performs the same function as choosing the DF= 
option in the Status Window. All subsequently 
created dimensions will use the specified font. 
Font styles -1 through -16 refer to new style 
fonts. Use of these fonts allows the fill mode and 
slant angle to be set independently. Font styles 1 
through 6 are old style fonts defined as follows:

1 = Box
2 = Slant
3 = Bold box filled
4 = Bold slant filled
5 = Bold box
6 = Bold slant

SET dimht XE "SET:DIMHT"  XE "DIMHT, SET" , height	height 
(fval) - Character height (0.0005 - 10000.0)

Sets the current dimension text height. This 
performs the same function as using the system's 
Immediate Mode command or choosing the 
DH= option in the Status Window. All 
subsequently created dimensions will have this 
height assigned.

SET dimslant XE "SET:DIMSLANT"  XE "DIMSLANT, SET" , angle
	angle (fval) - Slant angle (-31 - +31 degrees)

Sets the current dimension text slant angle. All 
subsequently created dimensions will have this 
slant angle. The angle ranges from 31 (extreme 
slant to the left) through -31 (extreme slant to 
the right), with 0 being the midpoint (i.e., no 
slant).

SET draword XE "SET:DRAWORD"  XE "DRAWORD, SET" , val
	val (ival) - Draw order switch

0 = Forward
1 = Backwards

Sets the system database search and draw order. 
This performs the same function as using the 
system's Immediate Mode command or choosing 
the DB: option in the Status Window.

SET dspaxes XE "SET:DSPAXES"  XE "DSPAXES, SET" , mode	mode 
(ival) - Display mode

0 = Off
1 = On (all viewports)

Controls the mode of the display view axes.

SET grid XE "SET:GRID"  XE "GRID, SET" , mode		mode 
(ival) - Grid mode

0 = Off
1 = Primary viewport
2 = All viewports

Controls the display of the grid. This performs 
the same function as using the system's 
Immediate Mode command or choosing the 
GRID: option in the Status Window.

SET gridinc XE "SET:GRIDINC"  XE "GRIDINC, SET" , xinc, yinc, 
[xalign], [yalign]

xinc (fval)	- Grid X increment
yinc (fval)	- Grid Y increment
xalign (fval)	- Grid X alignment
yalign (fval)	- Grid Y alignment

Controls the alignment position as well as the 
increment of the grid. If an alignment parameter 
is omitted, the default is zero.

SET immcom XE "SET:IMMCOM"  XE "IMMCOM, SET" , mode
	mode (ival) - Immediate Mode command switch

0 = Disable use of Immediate Mode commands
1 = Enable use of Immediate Mode commands

Enables or disables the use of Immediate Mode 
commands during CADL execution. At the start 
of each CADL session, Immediate Mode 
commands are always enabled. When the 
session is completed, Immediate Mode 
commands are automatically re-enabled if they 
have been disabled during the session.


SET leader XE "SET:LEADER"  XE "LEADER, SET" , style	style 
(ival) - Leader style

1 = Both	5 = Solid
2 = First	6 = 1st solid
3 = Second	7 = 2nd solid
4 = None	8 = No arrows
Sets the current leader display style. All 
subsequently created leaders will be this style. 
This performs the same function as using the 
system's Immediate Mode command or choosing 
the LDR: option in the Status Window.

SET level XE "SET:LEVEL"  XE "LEVEL, SET" , num		num 
(ival) - System level number (1-256)
 
Defines the current system level. This performs 
the same function as using the system's 
Immediate Mode command or using the cursor 
to select the ALEV= option from the Status 
Window. All subsequently created entities will 
have this level assigned. 
 
SET levelmask XE "SET:LEVELMASK"  XE "LEVELMASK, SET" , mask
	mask (ival) - Level mask array

Sets the CADKEY view levels as specified by the 
level mask array.  The array contains 16 integer 
elements. Each bit in each integer corresponds to 
a specific level. If the bit is 0, the level is not 
viewable, if set to 1, the level is displayed. The 
bits are arranged such that bits 0-15 of the first 
element correspond to levels 1-16, bits 0-15 of 
the second element correspond to levels 17-32, 
etc.

SET limit XE "SET:LIMIT"  XE "LIMIT, SET" , mode		mode 
(ival) - Line limit mode

0 = Function
1 = Viewport

Sets the current line segment termination mode 
of the CADKEY line creation function. This 
performs the same function as using the system's 
Immediate Mode command. If set to 0, the line 
endpoints will be coincident with the positions 
specified via cursor position, end of entity, etc. If 
set to 1, line segments are extended through the 
specified positions and terminate at the 
intersection with the boundary of the viewport 
of definition.

SET linetype XE "SET:LINETYPE"  XE "LINETYPE, SET" , type 
	type (ival) - Line type

1 = Solid 
2 = Dashed 
3 = Center line 
4 = Phantom line 
	
Defines the system's current line type for arc, 
circle, line, polygon, polyline and spline entities. 
This performs the same function as using the 
Immediate Mode command, or using the cursor 
to select the L-TYPE= option in the Status 
Window. All subsequently created entities will 
have this line type assigned. 

SET linewidth XE "SET:LINEWIDTH"  XE "LINEWIDTH, SET" , width 
	width (inum) - Line width (odd value from 1-15) 
 
Defines the system's current line width for arc, 
circle, line, polyline and spline entities. This 
provides the same function as using the 
Immediate Mode command, or using the cursor 
to select the L-WID= option in the Status 
Window. All subsequently created entities will 
have this line width assigned. 

SET mask XE "SET:MASK"  XE "MASK, SET"  [, ent1, ent2, ...]
			
			ent1 (ival) - Number of entity to be selected 
ent2 (ival) - Number of entity to be selected 

Sets the system selection mask. Only the entities 
specified may  be selected by subsequent 
GETENT or GETENTM commands. If no entity 
numbers are given, all entities are selectable. The 
entity numbers are defined as shown.
 
1	= Point    	        14 = Angular dimension 
2	= Line     	        15 = Note 
3	= Arc (circle)          16 = Label 
4	= Conic    	        17 = Leader
5	= Spline (2d and 3d)	18 = Witness 
6	= Polygon  	        19 = Cross hatch 
7	= Polyline 	        20 = Generic dimension 
11	= Linear dimension 	21 = Ordinate dimension 
12	= Radial dimension  	22 = Disk note
13	= Diametrical dimension  
    
SET maskcol XE "SET:MASKCOL"  XE "MASKCOL, SET" , mask
	mask (ival) - Colors to mask where
	
bit 0	= Color 0
bit 1	= Color 1
.
.
bit 15	= Color 15

Sets the selection color mask for any subsequent 
CADL command that invokes the CADKEY 
entity selection mechanism (i.e., GETENT, 
GETENTM, etc.). The mask is reset whenever a 
selection occurs or an exit is made from CADL.

SET maskent XE "SET:MASKENT"  XE "MASKENT, SET" , mask
	mask (fval) - Entities to mask where

bit 0 = Point	bit 8	= Linear, radial, 
diametrical, angular dimensions
bit 1 = Line	bit 9	= Label  
bit 2 = Arc	bit 10	= Note, disk note
bit 3 = Spline	bit 11	= Leader, witness
bit 4 = Polygon	bit 12	= Hatch 
bit 5 = Polyline	bit 13	= Ordinate 
dimension
bit 6 = Conic	bit 14	= Generic 
Dimension
bit 7 = Reserved

Sets the selection entity mask for any subsequent 
CADL command that invokes the CADKEY 
entity selection mechanism (i.e., GETENT, 
GETENTM, etc.). The mask is reset whenever a 
selection occurs or an exit is made from CADL.

SET masklevel XE "SET:MASKLEVEL"  XE "MASKLEVEL, SET" , lev
	lev (ival) - Masking level (1-256) 

Sets the selection level for any subsequent CADL 
command that invokes the CADKEY entity 
selection mechanism (i.e., GETENT, GETENTM, 
etc.). The mask is reset whenever a selection 
occurs or an exit is made from CADL. 

SET maskltype XE "SET:MASKLTYPE"  XE "MASKLTYPE, SET" , mask
	mask (ival) - Line type to mask where

bit 0 = Solid
bit 1 = Dashed
bit 2 = Center line
bit 3 = Phantom line

Sets the selection line type mask for any 
subsequent CADL command that invokes the 
CADKEY entity selection mechanism (i.e., 
GETENT, GETENTM, etc.). The mask is reset 
whenever a selection occurs or an exit is made 
from CADL.

SET masklwidth XE "SET:MASKLWIDTH"  XE "MASKLWIDTH, 
SET" , mask	mask (ival) - Line width to mask where

bit 0	= Width 1
bit 2	= Width 3
bit 4	= Width 5
.
.
bit 14	= Width 15

Sets the selection line width mask for any 
subsequent CADL command that invokes the 
CADKEY entity selection mechanism (i.e., 
GETENT, GETENTM, etc.). The mask is reset 
whenever a selection occurs or an exit is made 
from CADL.

SET maskpen XE "SET:MASKPEN"  XE "MASKPEN, SET" , mask
	mask (ival) - Pen to mask where

bit 0 = Pen 1
bit 2 = Pen 2
.
.
bit 7 = Pen 8

Sets the selection pen mask for any subsequent 
CADL command that invokes the CADKEY 
entity selection mechanism (i.e., GETENT, 
GETENTM, etc.). The mask is reset whenever a 
selection occurs or an exit is made from CADL.

SET noteang XE "SET:NOTEANG"  XE "NOTEANG, SET" , angle 
	angle (fval) - Note text rotation angle (degrees) 
 
Defines the angle of a vector along which all 
subsequently created note, disk note, and label 
text is drawn. The angle ranges from 0.0 (a 
horizontal vector running from left to right) 
through 360.0, measured in a counter-clockwise 
direction. 

SET notefill XE "SET:NOTEFILL"  XE "NOTEFILL, SET" , mode
	mode (ival) - Fill mode

0 = No fill
1 = Fill

Sets the current note text fill mode. All 
subsequently created notes will have this fill 
mode.

SET notefont XE "SET:NOTEFONT"  XE "NOTEFONT, SET" , font
	font (ival) - System font number (1-6, -1 through -16)
 
Sets the current system note text font. This 
performs the same function as using the system's 
Immediate Mode command or choosing the NF= 
option in the Status Window. All subsequently 
created notes, disk notes, and labels will use the 
specified font. Font styles -1 through -16 refer to 
new style fonts. Use of these fonts allows the fill 
mode and slant angle to be set independently. 
Font styles 1 through 6 are old style fonts 
defined as follows:

1 = Box 
2 = Slant 
3 = Bold box filled 
4 = Bold slant filled 
5 = Bold box 
6 = Bold slant 

SET noteht XE "SET:NOTEHT"  XE "NOTEHT, SET" , height 	height 
(fval) - Text height (0.0005-10000.0) 
 
Sets the current note text height. This performs 
the same function as using the system's 
Immediate Mode command or choosing the 
NH= option in the Status Window. All 
subsequently created notes, disk notes, and 
labels will have this height assigned.

SET noteline XE "SET:NOTELINE"  XE "NOTELINE, SET" , factor
	factor (fval) - Line spacing factor

Sets the current text line spacing factor for notes 
and labels. This factor times the character height 
equals the distance between the lines of text. All 
subsequently created notes, disk notes, and 
labels will use this factor.

SET noteslant XE "SET:NOTESLANT"  XE "NOTESLANT, SET" , angle
	angle (fval) - Slant angle (-31 - +31 degrees)

Sets the current note text slant angle. All 
subsequently created notes will have this slant 
angle. The angle ranges from 31 (extreme slant 
to the left) through -31 (extreme slant to the 
right), with 0 being the midpoint (i.e., no slant).

SET noteuline XE "SET:NOTEULINE"  XE "NOTEULINE, SET" , mode
	mode (ival) - Underline mode

0 = No underline
1 = Underline

Sets the current note text underline mode. All 
subsequently created notes, disk notes, and 
labels will have this underline mode.

SET notpath XE "SET:NOTPATH"  XE "NOTPATH, SET" , path
	path (word) - Note file directory path

Sets the default directory in which to find 
CADKEY note files. The use of slashes(/) or 
backslashes(\) is operating system dependent.

SET pen XE "SET:PEN"  XE "PEN, SET" , num		num (ival) - 
System pen number (1-8)

Defines the current pen number assigned. This 
performs the same function as using the system's 
Immediate Mode command, or using the cursor 
to select the PEN= option in the Status Window. 
All subsequently created entities will have this 
pen number assigned.

SET pltpath XE "SET:PLTPATH"  XE "PLTPATH, SET" , path	path 
(word) - Plot file directory path

Sets the default directory in which to find 
CADKEY plot files. The use of slashes(/) or 
backslashes(\) is operating system-dependent.

SET precision XE "SET:PRECISION"  XE "PRECISION, SET" , num
	num (ival) - CADL decimal precision

Sets the number of digits to the right of the 
decimal point for all  floating point values 
output as part of CADL file generation. The 
allowed range is from 4 to 10 digits. A value less 
than 4 or greater than 10 will be set to 4 or 10, 
respectively.

SET prtpath XE "SET:PRTPATH"  XE "PRTPATH, SET" , path	path 
(word) - Part file directory path

Sets the default directory in which to find 
CADKEY part files. The use of slashes(/) or 
backslashes(\) is operating system-dependent.

SET ptnpath XE "SET:PTNPATH"  XE "PTNPATH, SET" , path	path 
(word) - Pattern file directory path

Sets the default directory in which to find 
CADKEY pattern files. The use of slashes(/) or 
backslashes(\) is operating system dependent.

SET snap XE "SET:SNAP"  XE "SNAP, SET" , mode 	mode (ival) - 
Cursor snap mode

0 = Off
1 = On

Turns cursor snap on and off. This performs the 
same function as using the system's Immediate 
Mode command or choosing the SNAP: option in 
the Status Window.

SET snapinc XE "SET:SNAPINC"  XE "SNAPINC, SET" , xinc, yinc, 
[xalign], [yalign]	

xinc (fval)	- Snap X increment
yinc (fval)	- Snap Y increment
xalign (fval)	- Snap X alignment
yalign (fval)	- Snap Y alignment

Controls the alignment position as well as the 
increment of the cursor snap. If an alignment 
parameter is omitted, the default is zero.	

SET textasp XE "SET:TEXTASP"  XE "TEXTASP, SET" , ratio 	ratio 
(fval) - Text aspect ratio (.01-100.) 
 
Specifies the width/height ratio of text 
characters. A value of .5 will produce characters 
of normal aspect ratio. A value less than .5 
causes the characters to be compressed 
horizontally. A greater value causes expansion. 
All subsequently created text entities (i.e., notes, 
dimensions, etc.) will have this aspect ratio 
assigned. 
 
SET unit XE "SET:UNIT"  XE "UNIT, SET" , mode 		mode 
(ival) - System unit mode (0-5) 
 
Changes the current meaning of a system 
construction unit. Unit modes are defined as 
shown:
 
0 = Inches 	3 = Centimeters
1 = Millimeters 	4 = Yards
2 = Feet 	5 = Meters
 
For more information on the effects of the UNIT 
parameter, refer to the sections on DETAIL:SET, 
DETAIL:CHANGE, and DETAIL:UPDATE 
within the CADKEY User Reference Guide. 

SET versel XE "SET:VERSEL"  XE "VERSEL, SET" , mode	mode 
(ival) - Verify selection mode

0 = Off
1 = No

Turns selection verification on or off. This 
performs the same function as using the system's 
Immediate Mode command or choosing the 
VERSEL: option in the Status Window.

SET view XE "SET:VIEW"  XE "VIEW, SET" , num, vpnum	num 
(ival) - System view number
vpnum (ival) - Viewport number

0 or default = View of primary viewport is 
modified.
positive number = View of the specified 
viewport is modified.

Changes the view of the current part. This 
performs the same function as using the system's 
Immediate Mode command, or using the cursor 
to select the VIEW option in the Status Window, 
except that automatic redraw is not performed. 
When the display view is changed, a definition 
view is set for all new entities. 

SET witness XE "SET:WITNESS"  XE "WITNESS, SET" , mode	mode 
(ival) - Display mode

1 = Both
2 = First
3 = Second
4 = None

Controls the display of witness lines in 
dimensions. This performs the same function as 
using the system's Immediate Mode command 
or choosing the WIT: option in the Status 
Window. All subsequently created dimensions 
will use this witness line display mode.

SETATTR
SETATTR  XE "entity control:attributes"  XE "SETATTR " sets the 
attributes of the specified entity. The parameters correspond one-to-one 
to the attributes as defined by the most recent DEFATTR command 
(refer to DEFATTR). If a parameter is omitted, the corresponding 
attribute is left unchanged. Parameters which do not apply to a 
particular entity type are ignored. If a visual attribute is changed, the 
entity must be redrawn for the change to appear.


Format:
SETATTR [id], [val1], [val2], ...


Input Parameters: 
id (ival) 	Entity ID. If omitted, the currently selected 
entity is used. If set to -1, the attributes will be 
applied to all entities in the selection list.
val1 	First attribute value

val2 	Second attribute value

	Listed below are the ranges of permissible values 
for the various attributes:

	COLOR (ival):	        0-15 
	FCOLOR (ival):	        0-255
	GRPNUM (ival): 	        0-128
	LEVEL (ival): 	        1-256
	LINETYPE (ival):	1-4
	LINEWIDTH (ival):	1-15
	PEN (ival):	        1-8
	SUBGRP (ival):	        0-256
	TEXTANG (fval):	        0.0-360.0
	TEXTASP (fval):	        0.01-100.0
	TEXTFILL (ival):	0-1
	TEXTFONT (ival):	1-15
	TEXTHT (fval):	        0.0005-10000.0
	TEXTLINE (fval):	any value
	TEXTMIR (ival):	        0-1  
	TEXTSLANT (ival):	-31 through +31
	TEXTULINE (ival):	0-1

Line types 			Text fill, mirror, and underline 
modes

1 = Solid 			0 = Disable
2 = Dashed 			1 = Enable
3 = Center line
4 = Phantom line

Please note that setting either GRPNUM or SUBGRP to zero causes both 
attributes to be set to zero.

System Variables Set:
@ERROR(ivar) 	Error code:
	0 = No error
	1 = ID not found or no entity currently selected


Example:
DEFATTR COLOR, LTYPE, LWIDTH
SETATTR 23, 5, 1, 1
SETATTR 24,  , 1, 1
SETATTR 25, 5, 1, 1

This changes the entities having IDs 23 and 25 to have a color of 5, a 
solid line type, and a line width of 1. The entity with ID 24 will have its 
line type and line width changed similarly but not its color.

SETCUR
SETCUR  XE "SETCUR " sets the display of the current graphics cursor 
position to the specified view coordinate position. 
 

Format:
SETCUR x, y, [vpnum]
 

Input Parameters:
x (float)  	Cursor X position 

y (float)	Cursor Y position

vpnum (ival)	Viewport number:
	0 or default = Cursor positioned within primary 
viewport
	positive number = Cursor positioned within the 
specified viewport


System Variables Set:
@ERROR	0 = No error
	1 = Invalid viewport


SETNOTE
SETNOTE  XE "SETNOTE " sets the various current note text parameters 
such as height, aspect ratio, font, etc. This performs the same function as 
using the DETAIL,  SET function of the system. All subsequently created 
notes are assigned these attributes.


Format:
SETNOTE [ht], [asp], [rot], [font], [slnt], [fill], [lnsp], [uln]


Input Parameters:
ht (float)  	Text height in working units
	ht must be >= 0.005 and <= 10,000

asp (float)  	Aspect ratio of text (width/ht)
	asp must be >= 0.01 and <= 100
 
rot (float)  	Rotation angle (in degrees)
	rot must be >= 0 and <= 360

font (integer)  	Font number. A value between -16 and -1 
indicates a new style font. A value between 1 
and 6 indicates an old style font where:
	1 = Box
	2 = Slant
	3 = Bold box filled
	4 = Bold slant filled
	5 = Bold box
	6 = Bold slant

slnt (ival) 	Slant angle in degrees (ignored if old style font 
specified) 
	slnt must be >= -31 and <= 31

fill (ival) 	Fill flag (ignored if old style font specified)
	0 = No fill
	1 = Fill font

lnsp (fval) 	Line spacing factor. The distance between lines 
of text equals this factor times the character 
height.

uln (ival)  	Underline flag
	0 = No underline
	1 = Underline


SPLINE
The SPLINE  XE "primitives:SPLINE "  XE "SPLINE " data primitive 
describes a 2D or 3D cubic parametric spline in one of two ways:

1)	Using node points and start and end conditions.

2)	Using the coefficients of the cubic polynomial equations of each 
spline segment, where a segment is a piece of the curve between two 
node points. For reference, the equation used to describe a CADKEY 
cubic parametric spline for any segment is:

	xi = axi * u3 + bxi * u2 + cxi * u + dxi

	yi = ayi * u3 + byi * u2 + cyi * u + dyi

	zi = azi * u3 + bzi * u2 + czi * u + dzi

	where:

	u = a parameter value between 0 and 1 

Because of several parameters affecting the length and nature of the 
data in a spline primitive, the format of the primitive will be examined 
on a case-by-case basis.

The first two parameters in a spline primitive are always the same:

typecode (word) 	A character string type code specifying the type of 
spline and data being supplied. The format of this type 
code consists of a combination of the following 
character codes:
		The first character describes the form of data, where:

		P = node points 
		C = coefficients

		The second character describes the dimension of the 
                spline, where:

		2 = 2D 
		3 = 3D

		The third and fourth characters describe the start and 
                end conditions of the spline:

		N = natural (zero curvature) 
		V = slope of the tangent vector at the start or end point
		C = closed spline; end conditions are automatically 
                    defined  

		The N and V characters are required only when using 
                P for the first character of the typecode.

For example, P2NV describes a 2D spline primitive 
defined by node points, with natural curvature at the 
start point and a tangent vector describing the 
curvature at the end point.

arrayname (word)	Name of the array where node or coefficient 
data is stored. The format of the data in arrayname is 
dependent upon the type of spline being represented.

Usage 1


Format:
SPLINE typecode, arrayname, numpts, depth, [vnum], [col], [lev], 
[ltype], [grpnum], [subgrp], [pen], [lwdt]


Input Parameters:
typecode (word)  	P2NN, P2VN, P2NV, P2VV or P2C

arrayname (word) 	Name of the two-dimensional array where node 
points and tangent vector data is stored. In the case of 
a closed spline, if the first point in the array is 
erroneously duplicated at the end of the array, 
unpredictable results may occur. 

	The format of the data contained in arrayname is as 
follows:

	For typecode = P2NN:

	arrayname		[0][0] = X1 (X value for node point 
#1 in spline's view )
			[0][1] = Y1 (Y value for node point 
#1 in spline's view )
			..
			..
			[n-1][0] = Xn (X value for node point 
n in spline's view )
			[n-1][1] = Yn (Y value for node point 
n in spline's view )

	For typecode = P2VN: 

	arrayname		[0][0] = X1 (X value for node point 
#1 in spline's view )
			[0][1] = Y1 (Y value for node point 
#1 in spline's view )

			..
			..
[n-1][0]	=	Xn (X value for node point 
n in spline's view)
[n-1][1]	=	Yn (Y value for node point 
n in spline's view )
[n][0]	=	XV (X tangent vector 
component value for start 
in spline's view 
coordinates)
[n][1]	=	YV (Y tangent vector 
component value for start 
in spline's view 
coordinates)

	For typecode = P2NV: 

	arrayname		[0][0] = X1 (X value for node point 
#1 in spline's view )
			[0][1] = Y1 (Y value for node point 
#1 in spline's view )
			..
			..
[n-1][0]	=	Xn (X value for node point 
n in spline's view)
[n-1][1]	=	Yn (Y value for node point 
n in spline's view )
[n][0]	=	XV (X tangent vector 
component value for end 
in spline's view 
coordinates)
[n][1]	=	YV (Y tangent vector 
component value for end 
in spline's view 
coordinates)

	For typecode = P2VV:

	arrayname 		[0][0] = X1 (X value for node point 
#1 in spline's view )
			[0][1] = Y1 (Y value for node point 
#1 in spline's view )
			..
			..
[n-1][0]	=	Xn (X value for node point 
n in spline's view)
[n-1][1]	=	Yn (Y value for node point 
n in spline's view )	
[n][0]	=	XV1 (X tangent vector 
component value for start 
of spline in spline's view 
coordinates)
[n][1]	=	YV1 (Y tangent vector 
component value for start 
of spline in spline's view 
coordinates)
[n+1][0]	=	XV2 (X tangent vector 
component value for end 
of spline in spline's view 
coordinates)
[n+1][1]	=	YV2 (Y tangent vector 
component value for end 
of spline in spline's view 
coordinates)

	For typecode = P2C (n points will result in a closed 
spline of n segments):

	arrayname 		[0][0] = X1 (X value for node point 
#1 in spline's view )
			[0][1] = Y1 (Y value for node point 
#1 in spline's view )
			..
			..
			[n-1][0] = Xn (X value for node point 
n in spline's view )
			[n-1][1] = Yn (Y value for node point 
n in spline's view ) 

numpts (integer)	Number of node points in spline 
                        (open splines: >= 2 and <= 201, 
	         	closed splines: >=3 and <=200  )

depth (double)	 Constant depth of spline in the spline's definition 
view plane
vnum (integer) 	VIEW primitive reference number for spline's 
definition view. The VIEW primitive referenced must 
precede the spline primitive or the spline primitive 
will be ignored. If this parameter is absent or set to 0, 
the current system view is assumed.

col (integer)	Color assigned to the spline entity
	1-15 = Number in the system color palette
	0 = Use current system color

lev (integer)	Level number assigned to the spline entity
	1-256 = System level number
	0 = Use current system level

ltype (integer)	Line type number assigned to spline entity:
	1 = Solid
	2 = Dashed
	3 = Center line
	4 = Phantom line
	0 = Use current system line type

grpnum (integer)	Group reference number (1-127 or 0 if none)

subgrp (integer)  	Subgroup reference number (1-256 or 0 if none)

	Note : If you wish to specify a group, you must include 
both the group and the subgroup number.  If either of 
these arguments is missing, both of them will be 
ignored.

pen (integer)	Pen number assigned to spline entity
	1-8 = Pen number
	0 = Use current system pen number
	
lwdt (integer)	Line width to assign to spline entity.
	1-15 (odd only) = Line width
	0 = Use current system line width


Usage 2

Format:
SPLINE typecode, arrayname, numpts, [col], [lev], [ltype], [grpnum], 
[subgrp], [pen], [lwdt]

Input Parameters:
typecode (word) 	P3NO, P3VN, P3NV, P3VV or P3C
		
arrayname (word) 	Name of the two-dimensional array where node 
points and tangent vector data is stored. In the case of 
a closed spline, if the first point in the array is 
erroneously duplicated at the end of the array, 
unpredictable results may occur.

	The format of the data contained in arrayname is as 
follows:
		
	For typecode = P3NO:
		
	arrayname 		
[0][0] = X1 (X value for node point #1 in world coordinates)
[0][1] = Y1 (Y value for node point #1 in world coordinates)
[0][2] = Z1 (Z value for node point #1 in world coordinates)
			..
			..
[n-1][0] = Xn (X value for node point n in world coordinates)
[n-1][1] = Yn (Y value for node point n in world coordinates)
[n-1][2] = Zn (Z value for node point n in world coordinates)

	For typecode = P3VN or P3NV:
	
	arrayname 		
[0][0] =  X1 (X value for node point #1 in world coordinates)
[0][1] =  Y1 (Y value for node point #1 in world coordinates)
[0][2] =  Z1 (Z value for node point #1 in world coordinates)
			..
			..
[n-1][0] = Xn (X value for node point n in world coordinates)
[n-1][1] = Yn (Y value for node point n in world coordinates)
[n-1][2] = Zn (Z value for node point n in world coordinates)

[n][0] = XV (X tangent vector component value for start or 
        end of spline in world coordinates)
[n][1] = YV (Y tangent vector component value for start or 
        end of spline in world coordinates)
[n][2] = ZV (Z tangent vector component value for start or 
        end of spline in world coordinates)

For typecode = P3VV:

arrayname 		
[0][0] = X1 (X value for node point #1 in world coordinates)
[0][1] = Y1 (Y value for node point #1 in world coordinates)
[0][2] = Z1 (Z value for node point #1 in world coordinates)
        		..
			..
[n-1][0] = Xn (X value for node point n in world coordinates)
[n-1][1] = Yn (Y value for node point n in world coordinates)
[n-1][2] = Zn (Z value for node point n in world coordinates)
[n][0]	= XV1 (X tangent vector component value for start 
          of spline in world coordinates)
[n][1] =  YV1 (Y tangent vector component value for start 
          of spline in world coordinates)
[n][2]	= ZV1 (Z tangent vector component value for start 
          of spline in world coordinates)
[n+1][0]  = XV2 (X tangent vector component value for end 
          of spline in world coordinates)
[n+1][1]  = YV2 (Y tangent vector component value for end 
          of spline in world coordinates)
[n+1][2]  = ZV2 (Z tangent vector component value for end 
          of spline in world coordinates)

For typecode = P3C (n points will result in a closed 
spline of n segments):

arrayname 		
[0][0] = X1 (X value for node point #1 in world coordinates)
[0][1] = Y1 (Y value for node point #1 in world coordinates)
[0][2] = Z1 (Z value for node point #1 in world coordinates)
			..
			..
[n-1][0] = Xn (X value for node point n in world coordinates)
[n-1][1] = Yn (Y value for node point n in world coordinates)
[n-1][2] = Zn (Z value for node point n in world coordinates)   

numpts (integer)
col (integer)
lev (integer)
ltype (integer)	For a full description of these parameters, refer to 
Usage 1.
grpnum (integer)
subgrp (integer)
pen (integer)
lwdt (integer)


Usage 3

Format:
SPLINE	typecode, arrayname, numcoefs, depth, [vnum], [col], [lev], 
[ltype], [grpnum], [subgrp], [pen], [lwdt]


Input Parameters:
typecode (word) 	C2 (open), C2C (closed)
arrayname (word) 	Name of the two-dimensional array where 
coefficient values are stored. In the case of a closed 
spline, it is important to ensure that the necessary 
continuity conditions between the first and last 
segments are maintained and that the coefficients in 
the array are defined appropriately. 

The format of the data contained in arrayname is as follows:
		
	For typecode = C2, C2C:

arrayname	
[0][0] = C1 (ax coefficient for equation of 1st spline segment)
[0][1] = C2 (bx coefficient for equation of 1st spline segment)
[0][2] = C3 (cx coefficient for equation of 1st spline segment)
[0][3] = C4 (dx coefficient for equation of 1st spline segment)
[0][4] = C5 (ay coefficient for equation of 1st spline segment)
[0][5] = C6 (by coefficient for equation of 1st spline segment)
[0][6] = C7 (cy coefficient for equation of 1st spline segment)
[0][7] = C8 (dy coefficient for equation of 1st spline segment)
		..
		..
[n-1][0] = C1 (ax coefficient for equation of nth spline segment)
[n-1][1] = C2 (bx coefficient for equation of nth spline segment)
[n-1][2] = C3 (cx coefficient for equation of nth spline segment)
[n-1][3] = C4 (dx coefficient for equation of nth spline segment)
[n-1][4] = C5 (ay coefficient for equation of nth spline segment)
[n-1][5] = C6 (by coefficient for equation of nth spline segment)
[n-1][6] = C7 (cy coefficient for equation of nth spline segment)
[n-1][7] = C8 (dy coefficient for equation of nth spline segment)
		

numcoefs (integer) number of coefficient sets supplied ( >= 1 and <= 200 )

depth (double)
vnum (ival)
col (integer)
lev (integer) 	For a full description of these parameters, refer to 
Usage 1.
ltype (integer)
grpnum (integer)
subgrp (integer)
pen (integer)
lwdt (integer)


Usage 4

Format:
SPLINE typecode, arrayname, numcoefs, [col], [lev], [ltype], [grpnum], 
[subgrp], [pen], [lwdt]


Input Parameters:
typecode (word)	C3 (open), C3C (closed)

arrayname (word) 	Name of the two-dimensional array where 
coefficient values are stored. In the case of a closed 
spline, it is important to ensure that the necessary 
continuity between the first and last segments are 
maintained and that the coefficients in the array are 
defined appropriately. 

The format of the data contained in arrayname is as follows:  
		
	For typecode = C3, C3C:

arrayname 	
[0][0] = C1 (ax coefficient for equation of 1st spline segment)
[0][1] = C2 (bx coefficient for equation of 1st spline segment)
[0][2] = C3 (cx coefficient for equation of 1st spline segment)
[0][3] = C4 (dx coefficient for equation of 1st spline segment)
[0][4] = C5 (ay coefficient for equation of 1st spline segment)
[0][5] = C6 (by coefficient for equation of 1st spline segment)
[0][6] = C7 (cy coefficient for equation of 1st spline segment)
[0][7] = C8 (dy coefficient for equation of 1st spline segment)
[0][8] = C9 (az coefficient for equation of 1st spline segment)
[0][9] = C10 (bz coefficient for equation of 1st spline segment)
[0][10] = C11 (cz coefficient for equation of 1st spline segment)
[0][11] = C12 (dz coefficient for equation of 1st spline segment)
			..
			..
[n-1][0] = C1 (ax coefficient for equation of nth spline segment)
[n-1][1] = C2 (bx coefficient for equation of nth spline segment)
[n-1][2] = C3 (cx coefficient for equation of nth spline segment)
[n-1][3] = C4 (dx coefficient for equation of nth spline segment)
[n-1][4] = C5 (ay coefficient for equation of nth spline segment)
[n-1][5] = C6 (by coefficient for equation of nth spline segment)
[n-1][6] = C7 (cy coefficient for equation of nth spline segment)
[n-1][7] = C8 (dy coefficient for equation of nth spline segment)
[n-1][8] = C9 (az coefficient for equation of nth spline segment)
[n-1][9] = C10 (bz coefficient for equation of nth spline segment)
[n-1][10] = C11 (cz coefficient for equation of nth spline segment)
[n-1][11] = C12 (dz coefficient for equation of nth spline segment)

numcoefs (integer) number of coefficient sets supplied ( >= 3 and <= 200 )

col (integer)
lev (integer) 	For a full description of these parameters, refer to 
Usage 1. 
ltype (integer)
grpnum (integer)
subgrp (integer)
pen (integer)
lwdt (integer)


SPRINT
SPRINT  XE "SPRINT " allows the user to write characters, integers, and 
floating point numbers into a string variable through the use of a format 
string.

The format string contains any number of field specifiers, used to 
describe how values should be converted. For each specifier, a value is 
parsed from the statement and placed into the string variable 
accordingly. If there is no matching value for a format specification or 
there is an error in its evaluation, the characters "???" are used in lieu of 
the value. Refer to the Introduction of this CADL guide for a description 
of field specifiers.


Format:
SPRINT str, format [, val1, ...]


Input Parameters:
format (string) 	Format control string

val1 (val) 	First value to output based on first field specifier


Output Parameter:
str (string) 	Variable to store return string. Variable name 
must begin with a '$' character. The returned 
string will be a null terminated array of 
characters.


sys_addvp
 xe "sys_addvp"  xe "viewports:adding" The sys_addvp command adds a 
viewport to CADKEY's drawing area.  The viewport is defined in 
normalized device coordinates (NDC).  If the new viewport overlaps 
any existing viewports, an error is returned and the viewport is not 
added.  The total number of viewports cannot exceed the limit set in the 
configuration program.


Format:
sys_addvp xl, yl, xu, yu


Input Parameters:
xl (double)	X value of lower left corner in NDC

yl (double)	Y value of lower left corner in NDC

xu (double)	X value of upper right corner in NDC

yu (double)	Y value of upper right corner in NDC


System Variables Set:
@ERROR	Viewport number or one of the following errors:
	-32 = No more viewports available
	-33 = Bad viewport definition
	-34 = New viewport overlaps existing viewports

sys_autovp
 XE "sys_autovp"  XE "viewports:default configurations" The sys_autovp  
command sets up CADKEY's graphics area to one of the eight standard 
viewport configurations. The code for the desired configuration and the 
number for primary view port have to be provided as arguments.  If the 
primary viewport number is out of range, the first viewport is used.


Format:
sys_autovp code, prime


Input Parameters:
code (integer)	Viewport configuration code:
	0 = Single
	1 = 2 Vertical
	2 = 2 Horizontal
	3 = 2 Left, 1 Right
	4 = 1 Left, 2 Right
	5 = 2 Bottom, 1 Top
	6 = 1 Bottom, 2 Top
	7 = Quad
prime (integer)	Primary viewport number


System Variables Set:
@ERROR  	   0	= No error
	-26	= Bad viewport code
	-32	= Insufficient number of viewports available
sys_delvp
 xe "sys_delvp"  xe "viewports:removing" The sys_delvp command 
deletes a viewport from CADKEY's graphics area.  If the primary 
viewport is deleted, the lowest numbered viewport becomes the primary 
viewport.  It is possible to delete all viewports from the screen.  This 
could be useful for custom configuration of viewports.


Format:
sys_delvp vpnum


Input Parameter:
vpnum (integer) 	Viewport number


sys_get_name
The sys_get_name xe "sys_get_name"  command allows you to inquire 
about the descriptor (name) of an existing view or level.


Format:
sys_get_name item, number, $name


Input Parameters:
item (integer)	Item type:
	1 = Level  name is inquired 
	2 = View name is inquired
number(long)	Level  or view number


Output Parameter:
$name(string)	Level or view name. String must have a length 
of 30 characters.


System Variables Set:
@ERROR 	   0 	= No error
	-26	= Bad level or view number
	-24	= Level or View not defined

sys_inqtbsize
 XE "sys_inqtbsize" The sys_inqtbsize command is used to find out the 
NDC size of a text box of rows and columns.  This information can be 
useful when resizing a viewport so that it does not overlap a dialog box.
Format:
sys_inqtbsize numrow, numcol, xsize, ysize


Input Parameters:
numrow (integer)	Number of rows in text box

numcol (integer)	Number of columns in text box


Output Parameters:
xsize (double)	NDC x size

ysize (double)	NDC y size


System Variables Set:
@ERROR	   0	= No error
	-26	= Invalid number of rows or columns
	-35	= Specified text box is too big

sys_inqvpdef
 XE "sys_inqvpdef"  XE "viewports:definition coordinates" The 
sys_inqvpdef command is used to find out the definition coordinates of 
a viewport, based on the graphics viewport.  The viewport is specified by 
its number and the NDC coordinates are returned in the variables 
provided. 


Format:
sys_inqvpdef vpnum, xl, yl, xu, yu


Input Parameter:
vpnum (integer)	Viewport number


Output Parameters:
xl (double)	X value of lower left corner

yl (double)	Y value of lower left corner

xu (double)	X value of upper right corner

yu (double)	Y value of upper right corner
System Variables Set:
@ERROR	   0	= No error
	-32	= Specified viewport doesn't exist

sys_inqvpinfo
 XE "viewports:retrieving information"  XE "sys_inqvpinfo" The 
sys_inqvpinfo command is used to find out the viewport configuration 
mask and the number of the primary viewport.  The viewport 
configuration is stored as an integer bitmask to indicate which 
viewports are active.  The first bit (bit 0) corresponds to viewport 
number 1, the second bit (bit 1) corresponds to viewport number 2 and 
so on.  When the mask is read using the sys_inqvpinfo command, a 1 in a 
viewport's bit indicates it is active.  When a new viewport is added, it 
uses the lowest order bit available.  When a viewport is deleted its 
corresponding bit in the mask is set to zero.  The command also returns 
the total number of available viewports.


Format:
sys_inqvpinfo mask, prime


Output Parameters:
mask (uint)	Viewport mask

prime (integer)	Primary viewport number


System Variables Set:
@ERROR 	Number of available viewports

sys_movevp
 XE "sys_movevp"  XE "viewports:moving"  XE "viewports:resizing" An 
existing viewport can be resized or moved using the sys_movevp 
command.  The viewport is specified by its number, and new values for 
its lower-left and upper-right corners are provided.  To resize a 
viewport, inquire its coordinates using the INQVPDEF command and 
reuse these values for one corner.  A viewport cannot be moved or 
resized to overlap other viewports.


Format:
sys_movevp vpnum, xl, yl, xu, yu

Input Parameters:
vpnum (integer)	Viewport number

xl (double)	X value of lower left corner in NDC

yl (double)	Y value of lower left corner in NDC

xu(double)	X value of upper right corner in NDC

yu (double)	Y value of upper right corner in NDC


System Variables Set:
@ERROR	   0	= No error
	-32	= Specified viewport doesn't exist
	-33	= Bad viewport definition
	-34	= New definition overlaps existing viewports

sys_prt_desc_inq
The sys_prt_desc_inq XE "sys_prt_desc_inq"  command allows you to 
read the descriptor (name) of a currently loaded part file.  It is necessary 
to allocate sufficient memory for the descriptor.


Format:
sys_prt_desc_inq $desc


Input Parameters:
none

Output Parameter:
$desc (string)	Part file descriptor 
	The maximum possible length of $desc is equal 
to 512. Anything longer than this will be 
truncated.
System Variables Set:
@ERROR	-37 = Bad part file opened
	-36 = No error

sys_prt_desc_set
sys_prt_desc_set XE "sys_prt_desc_set"  allows you to modify the 
descriptor (name) of a currently loaded part file.


Format:
sys_prt_desc_set $desc


Input Parameter:
$desc (string)	Part file descriptor 
	The maximum possible length of $desc is equal 
to 512. Anything longer than this will be 
truncated.


Output Parameters:
none

System Variables Set:
@ERROR	  -9	= Error writing to part file
	-10	= Error reading from part file
	-36	= No error
	-37	= Bad part file opened

sys_prt_load
 XE "sys_prt_load" The sys_prt_load command loads a part file in 
CADKEY.  The return values -2, -5, and -25 are warnings.  They indicate 
the condition of the loaded part file.  Other return values are errors.  The 
part file is not loaded if an error occurs.


Format:
sys_prt_load $fname


Input Parameter:
$fname (string)	Part file name

System Variables Set:
@ERROR	   0	= No error
	  -1	= Cannot build part file name
	  -2	= Locked by someone else
	  -5	= File is read-only	
	  -7	= No environment space
	  -8	= Part file open error	
	-10	= Part file read error
	-11	= Seek error
	-15	= Unexpected entity
	-16	= Work file open error
	-17	= Name file open error
	-18	= Work file output error
	-19	= Name file output error
	-20	= Work file input error
	-21	= Name file input error
	-22	= Wrong part file version
	-23	= Not a part file
	-24	= Part file not found
	-25	= Can't lock file


sys_prt_save
 XE "sys_prt_save" The sys_prt_save command saves a CADKEY part 
file.  The part file can be locked while saving it by setting the lock flag to 
1.  If the overwrite flag is set to 1, any existing part file with the same 
name will be overwritten.


Format:
sys_prt_save $name, lock, force


Input Parameters:
$fname (string)	Part filename

lock (integer)	Lock flag:
	0 = Do no lock part file
	1 = Lock part file
force (integer)	Overwrite flag:
	0 = Do no overwrite existing part file
	1 = Overwrite any existing part file

System Variables Set:
@ERROR	   0	= No error
	  -1	= Can't build part filename
	  -2	= Part file is locked
	  -3	= Can't access part file
	  -4	= Part file already exists
	  -5	= Part file is read only
	  -6	= Can't create part file
	  -7	= No environment space
	  -8	= Part file open error
	  -9	= Part file output error
	-11	= Seek error
	-15	= Unexpected entity
	-16	= Work file open error
	-17	= Name file open error
	-18	= Work file output error
	-19	= Name file output error
	-20	= Work file input error
	-21	= Name file input error
sys_ptn_load
The sys_ptn_load xe "sys_ptn_load"  command loads a pattern file into 
CADKEY.  All options in CADKEY's interactive pattern load function 
are available as arguments for this command.  The view in which the 
pattern is brought in can be specified in two ways.  Either the view 
number of an existing view can be provided, or a view matrix can be 
provided as a nine-element one-dimensional array.  The view matrix 
must meet all criteria of CADKEY's view matrices. (Refer to the VIEW 
command for more detail.)


Format:
sys_ptn_load $fname, $gname, subgrp, lev_opt, lev, scl, rot, vnum, vmat, 
x, y, z


Input Parameters:
$fname (string)	Pattern filename
$gname (string)	Group name
subgrp (integer)	Subgroup number

Note : If you wish to specify a group, you must 
include both the group name and the subgroup 
number.  If the group name is a null string or the 
subgroup number is missing, the entities will not 
be grouped.

lev_opt (integer)	Level option
	1 = Current level
	2 = Entity level
	3 = New level
	4 = Level offset
lev (integer)	New level number if lev_opt was set to 3; 
	or level offset if option 4 was used
scl (double)	Scale for pattern
rot (double)	Rotation angle in degrees
vnum (long)	View number to use if no view matrix is 
provided
vmat[9] (double)	View matrix
	NULL = use view number
x (double)	X value of base point in view coordinates of 
specified view
y (double)	Y value of base point in view coordinates of 
specified view
z (double)	Z value of base point in view coordinates of 
specified view

System Variables Set:
@ERROR	   0	= No error
	  -1	= Can't build pattern filename
	  -8	= Pattern file open error
	-10	= Pattern file input error
	-11	= Seek error
	-15	= Unexpected entity
	-22	= Wrong pattern file version
	-23	= Not a pattern file
	-26	= Bad value for fname, gname, subgrp, 
lev_opt, lev or scl option
	-28	= Bad view matrix
	-29	= Bad view number
	-30	= Level offset causes invalid level
	-31	= No room for new group
sys_ptn_save
 xe "sys_ptn_save" The sys_ptn_save command saves a CADKEY 
pattern file.  The entities for the pattern can be specified by a list of IDs 
or the selection list.  The selection list is built using the GETENTM or 
GETALL command.  The view in which the pattern is created can be 
specified in two ways.  Either the view number of an existing view can 
be provided, or a view matrix can be provided as a nine-element one-
dimensional array.  The view matrix must meet all criteria of CADKEY's 
view matrices (refer to the VIEW command in the Primitives section for 
more detail).  If the overwrite flag is set to 1, any existing pattern file 
with the same name will be over written.

Format:
sys_ptn_save $fname, numid, id, vnum, vmat, x, y, z, force


Input Parameters:
$fname (string)	Pattern filename
numid (integer)	Number of entity IDs 
	-1 = Use selection list
id[] (ulong)	Entity IDs (NULL when using selection list)
vnum (long)	View number to use if no view matrix is 
provided
vmat[9] (double)	View matrix (NULL when using view number)
x (double)	X value of base point
y (double)	Y value of base point
z (double)	Z value of base point
force (integer)	Overwrite flag:
	0 = Do not overwrite existing pattern file
	1 = Overwrite any existing pattern file

System Variables Set:
@ERROR	  0	= No error
	 -1	= Can't build pattern filename
	 -4	= Pattern file already exists
	 -6	= Can't create pattern file
	 -8	= Pattern file open error
	 -9	= Pattern file output error
	-15	= Unexpected entity
	-26	= Bad numid or id
	-27	= No entities in selection list
	-28	= Bad view matrix
	-29	= Bad view number

sys_put_name
sys_put_name xe "sys_put_name"  allows you to set the descriptor 
(name) of an existing view or a level. 


Format:
sys_put_name item, number, $name


Input Parameters:
item (integer)	Item type:
	1 = Level name is to be set
	2 = View name is to be set
number (long)	Level  or view number
$name (string)	Level or view name
	The maximum possible length of name is equal 
to 512. Any name  longer than this will be 
truncated.


System Variables Set:
@ERROR	   0	= No error
	-26	= Bad level or view number
	-24	= Level or View not defined

VIEW
The VIEW  XE "primitives:VIEW "  XE "VIEW " primitive describes the 
plane in which a planar primitive (such as an ARC, CIRCLE or TEXT) is 
defined. This primitive contains the information necessary to define a 
geometric plane, using a 3 X 3 rotation matrix.

A VIEW primitive must precede the planar primitive referencing it. 
When a CADL file is read in and executed by the system, a check is 
performed to see if a new view must be created in the part database each 
time a VIEW primitive is encountered.


Format:
VIEW refno, t1, t2, t3, t4, t5, t6, t7, t8, t9


Input Parameters:
t1 - t9 (double)	Elements in the rotation matrix are in the 
following order:    

	| t1    t2    t3 |
	| t4    t5    t6 |
	| t7    t8    t9 |

This 3 X 3 rotation matrix defines the X, Y and Z 
axis rotation about the part model origin ( X = 0, 
Y = 0, Z = 0) relative to model space, or the 
system's view 1 (TOP view). In this system, X is 
the horizontal axis, Y is the vertical axis, and Z is 
the axis pointing out of the plane. 

	The following  characteristics apply to the view 
rotation matrix:    

	1.   It is orthogonal in the linear algebraic sense 
(i.e., its transpose is its inverse).

	2.   It has a positive determinant.

	Reference Coordinate System (Model space or 
View 1)

Rotation about the X axis is given by:

|	1	0	0	|
|	0	cos X	-sin X	|
|	0	sin X	cos X	|


Rotation about the Y axis is given by:

|	cos Y	0	sin Y	|
|	0	1	0	|
|	-sin Y	0	cos Y 	|


Rotation about the Z axis is given by:

|	cos Z	-sin Z	0	|
|	sin Z	cos Z	0	|
|	0	0	1	|



Output Parameters:
refno (integer)	View number in CADL for other primitives to 
reference



VLINE
The VLINE  XE "primitives:VLINE "  XE "VLINE " primitive describes the 
two endpoints of a line in X, Y, Z view coordinates.

When a VLINE primitive is read from a CADL file, this primitive is 
stored in the system's database as a line entity.

When a line entity is written to a CADL file, it is output as a VLINE 
primitive provided that 2D construction mode is in effect. If this switch 
is set for 3D, line entities are dumped as LINE primitives. When a VLINE 
primitive is output, a VIEW primitive is output first (if necessary) which 
the VLINE primitive may reference as the view that its coordinates are 
described in.

The line length itself must be greater than or equal to 0.0005, and less 
than or equal to 10,000.


Format:
VLINE  x1, y1, z1, x2, y2, z2, [vnum], [col], [lev], [ltype], [grpnum], 
[subgrp], [pen], [lwdt]


Input Parameters:
x1 (double)	X value of the first endpoint in view coordinates

y1 (double)	Y value of the first endpoint in view coordinates

z1 (double)   	Z value of the first endpoint in view coordinates

x2 (double)	X value of the second endpoint in view 
coordinates

y2 (double)	Y value of the second endpoint in view 
coordinates

z2 (double) 	Z value of the second endpoint in view 
coordinates

vnum (integer)	VIEW primitive reference number. The VIEW 
primitive referenced must precede this primitive 
or an error message is displayed and the 
program is terminated.
	0 = Use current system view in effect

col (integer)	Color 
	0-15 = Number in the system color palette

lev (integer)	Level number 
	1-256 = System level number
	0 = Use current system level in effect 

ltype (integer)	Line type:
	1 = Solid 
	2 = Dashed 
	3 = Center line 
	4 = Phantom line 
	0 = Use current system line type in effect 

grpnum (integer)	Group reference number 
	1-127 = Group number 
	0 = No group assignment

subgrp (integer)  	Subgroup reference number 
	1-256 = Subgroup number
	0 = No subgroup assignment

Note : If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero(0), both of them will be ignored.

pen (integer)	Pen number 
	1-8 = Pen number 
	0 = Use current system pen number in effect 

lwdt (integer)	Line width 
	1-15 = Odd line width
	0 = Use current system line width in effect 



VPOINT
The VPOINT  XE "primitives:VPOINT "  XE "VPOINT " primitive 
describes an X,Y location in view coordinates.  When a VPOINT 
primitive is read from a CADL file, this primitive is stored in the 
system's database as a point entity.
When a point entity is written to a CADL file, it is output as a VPOINT 
primitive provided that 2D construction mode is in effect. If this switch 
is set to 3D, the point entities are dumped as POINT primitives. When a 
VPOINT primitive is output, a VIEW primitive is output first (if 
necessary) which the VPOINT primitive may reference as the view that 
its coordinates are described in.


Format:
VPOINT x, y, z, vnum, [col], [lev], [grpnum], [subgrp], [pen]


Input Parameters:
x (double)	X value of point in view coordinates

y (double)	Y value of point in view coordinates 

z (double)	Z value of point in view coordinates

vnum (integer)	VIEW primitive reference number. The VIEW 
primitive referenced must precede this primitive 
or an error message is displayed and the 
program is terminated.
	0 = Use current system view in effect

col (integer)	Color 
	0-15 = Number in the system color palette 

lev (integer)	Level number 
	1-256 = System level number 
	0 = Use current system level in effect 

grpnum (integer) 	Group reference number 
	1-127 = Group number 
	0 = No group assignment

subgrp (integer)  	Subgroup reference number 
	1-256 = Subgroup number 
	0 = No subgroup assignment

Note : If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero(0), both of them will be ignored.

pen (integer)	Pen number 
	1-8 = Pen number 
	0 = Use current system pen number in effect


VPOLYGON
A VPOLYGON  XE "primitives:VPOLYGON "  XE "VPOLYGON 
" primitive describes a polygon of up to eight vertices. Although a 
polygon is normally thought of as a planar figure, there is no restriction 
that the vertices must lie in a plane.

When a VPOLYGON primitive is read from a CADL file, this primitive is 
stored in the system's database as a polygon entity. All polygon entities 
are output to CADL as polygon primitives regardless of the 2D/3D 
switch.


Format:
VPOLYGON filltype, fillcolor, numpts, arrayname, depth, [vnum], [col], 
[lev], [ltype], [grpnum], [subgrp], [pen]


Input Parameters:
ftype (integer)	Fill type 
	1 = Unfilled 
	2 = Filled

fcol (integer)	Color of polygon if filled.  Otherwise, color of 
outline is specified by col.
	Range of fcol is from 0-255. 

numpts (integer)	Number of points in polygon.  Minimum and 
maximum values are 3 and 8, 
	respectively. 

arrayname (string) 	Name of one-dimensional data array containing 
planar polygon data as follows:
	arrayname	[0] = x (1st point) 
			[1] = y 
			..
			..
			[n-2] = x (last point) 
			[n-1] = y

First and last point need not be identical to force 
closure; closure is automatic. Polygon is created 
in view defined by vnum at the z position 
specified by depth. 

depth (double)	Z depth of polygon 

vnum (integer)	VIEW primitive reference number. The VIEW 
primitive referenced must precede this primitive 
or an error message is displayed and the 
program is terminated.
	0 = Use current system view in effect

col (integer)	Polygon border color
	0-15 = Number in the system color palette 
		
lev (integer)	Level number 
	1-256 = System level number
	0 = Use current system level in effect 

ltype (integer)	Line type:
	1 = Solid 
	2 = Dashed 
	3 = Center line
	4 = Phantom line 
	0 = Use current system line type in effect 

grpnum (integer)  	Group reference number 
	1-127 = Group number 
	0 = No group assignment

subgrp (integer)   	Subgroup reference number 
	1-256 = Subgroup number 
	0 = No subgroup assignment

Note : If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero (0), both of them will be ignored.

pen (integer)	Pen number 
	1-8 = Pen number 
	0 = Use current system pen number in effect 


WAIT
WAIT  XE "WAIT " s XE "program control statements:WAIT" uspends a 
CADL file execution for a specified number of seconds.  


Format:
WAIT numsec 
       

Input Parameter:
numsec (fval)    	Number of seconds to wait 


WINDOW
WINDOW  XE "scaling:scale to window"  XE "viewports:zoom in on a 
window"  XE "WINDOW " performs a zooming function on the current 
part displayed, which is the equivalent of using the Immediate Mode 
command. An automatic redraw is not performed.

 
Format:
WINDOW xmin, ymin, xmax, ymax, [vpnum]
 

Input Parameters: 
xmin (float) 	X minimum value of window size in display 
view coordinates

ymin (float) 	Y minimum value of window size in display 
view coordinates

xmax (float) 	X maximum value of window size in display 
view coordinates

ymax (float) 	Y maximum value of window size in display 
view coordinates

vpnum (ival)	Viewport number:
	-1 = All viewports windowed according to 
indicated coordinates 
	0 or default = Primary viewport windowed 
according to 	
	indicated coordinates
	Positive number = Only designated viewport

 
System Variables Set:
@ERROR	0 = No error
	1 = Invalid viewport


WITNESS
The WITNESS  XE "detail entities:witness line"  XE "primitives:WITNESS 
"  XE "WITNESS " primitive describes the geometry found in a CADKEY 
witness line entity.  When a WITNESS primitive is read from a CADL 
file, a witness line entity is created in the database. 

When a witness line entity is written to a CADL file, a VIEW primitive is 
output first (if necessary) which the WITNESS primitive may reference 
as its assigned plane. 


Format:
WITNESS x1, y1, x2, y2, [vnum], [col], [lev], [ltype], [grpnum], [subgrp], 
[pen]


Input Parameters:
x1 (double)	X value of witness line's endpoint 1 in view 
coordinates

y1 (double)	Y value of witness line's endpoint 1 in view 
coordinates

x2 (double)	X value of witness line's endpoint 2 in view 
coordinates

y2 (double)	Y value of witness line's endpoint 2 in view 
coordinates

vnum (integer) 	VIEW primitive reference number. The VIEW 
primitive referenced must precede this primitive 
or an error message is displayed and the 
program is terminated.
	0 = Use current system view in effect

col (integer)	Color 
	0-15 = Number in the system color palette 

lev (integer)	Level number 
	1-256 = System level number 
	0 = Use current system level in effect 

ltype (integer)	Line type:
	1 = Solid
	2 = Dashed
	3 = Center line
	4 = Phantom line
	0 = Use current system line type in effect

grpnum (integer)  	Group reference number 
	1-127 = Group number 
	0 = No group assignment
subgrp (integer)   	Subgroup reference number 
	1-256 = Subgroup number 
	0 = No subgroup assignment

Note: If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero(0), both of them will be ignored.

pen (integer)	Pen number 
	1-8 = Pen number 
	0 = Use current system pen number in effect


WRITE
WRITE  XE "WRITE " complements the READ statement by providing a 
means of writing out variable values to a data file. Except for arrays, 
each variable name in the statement causes one value to be written to 
the file. The manner in which arrays are handled is similar to READ in 
that the number of values output for an array is determined by the array 
declaration and the number of dimensions specified. 

Processing of the file specification is as follows: 

1) 	If the specification does not include a path, the directory used 
is the default directory for CADL programs (set with the 
CONFIG program).
2) 	If a full path is included, the specified directory is used.
3) 	If the specification includes a relative path, the specified 
directory is relative to the current working directory.
 
Four file open modes are supported:

Mode 0 -	causes existing file data to be overwritten by new data.  
If it's the first time the file is accessed (within the 
current CADL session), writing starts at the beginning 
of the file.  Otherwise, it continues where the last write 
left off.  

Mode 1 -	causes data to be appended to existing file data. If the 
file doesn't exist, a new one is created.  

Mode 2 -	insures that a new data file is created for the WRITE.  

Mode 3 -	appends data similarly to mode 1, but doesn't create the 
file if it doesn't exist. 
 

Format:  	
WRITE fname, mode, var1 [, var2, ...] 
 

Input Parameters: 
fname (word)  	Data file specification 
 
mode (ival)  	Open mode:
	0 = Overwrite file 
	1 = Append to end of file 
	2 = Create new file only 
	3 = Append to existing file only 
 
var1 (var)  	Name of first variable 
 
var2 (var)  	Name of second variable 
 

System Variables Set: 
@ERROR (ivar)	Error code: 
	 0	=	No error 
	-1	= 	File already exists (write mode 2) or file 
not found (write mode 3) 
	 1	=	Cannot open file
 


XHATCH
The XHATCH  XE "primitives:XHATCH "  XE "XHATCH " primitive 
describes the geometry in a CADKEY cross-hatch entity.

When an XHATCH primitive is read from a CADL file, a cross-hatch 
entity is created in the database. 

When a cross-hatch entity is written to a CADL file, a VIEW primitive is 
created first (if necessary) for which the XHATCH primitive may 
reference as its assigned plane. 


Format:
XHATCH pattern, numlines, arrayname, [vnum], [col], [lev], [ltype], 
[grpnum], [subgrp], [pen]


Input Parameters:
pattern (integer)   	Hatch pattern (range of 1-18)

numlines (integer)	Number of lines in crosshatch 

arrayname (string) 	Name of one-dimensional data array containing 
line data as follows:

	arrayname	[0] = x1 (1st line) 
			[1] = y1 
			[2] = x2 
			[3] = y2
			.. 
			..
			[n-4] = x1 (last line) 
			[n-3] = y1 
			[n-2] = x2 
			[n-1] = y2

vnum (integer)	VIEW primitive reference number. The VIEW 
primitive referenced must precede this primitive 
or an error message is displayed and the 
program is terminated.
	0 = Use current system view in effect

col (integer)	Color 
	0-15 = Number in the system color palette

lev (integer)	Level number 
	1-256 = System level number
	0 = Use current system level in effect 

ltype (integer) 	Line type:
	1 = Solid 
	2 = Dashed 
	3 = Center line 
	4 = Phantom line 
	0 = Use current system line type in effect 

grpnum (integer)  	Group reference number 
	1-127 = Group number 
	0 = No group assignment

subgrp (integer)    	Subgroup reference number 
	1-256 = Subgroup number
	0 = No subgroup assignment

Note : If you wish to specify a group, you must 
include both the group and the subgroup 
number.  If either of these arguments is missing 
or set to zero (0), both of them will be ignored.

pen (integer)	Pen number
	1-8 = Pen number
	0 = Use current system pen number in effect


______________________________________________________________________________

Section Four: CADL Compiler
Table Of Contents

Introduction to CCOMP
CCOMP Files
Using CCOMP
Command Line Options
Compiler Directives
#DEFINE
#IFDEF, #IFNDEF
#INCLUDE
#UNDEF
Compiler Specific Commands
/* comment string */
CONTINUE
DO ... WHILE
EXITLOOP
FOR
IF ... ELSE IF ... ELSE
LOCAL
SWITCH
WHILE


Introduction to CCOMP
CCOMP  XE "CCOMP "  XE "compiler" is a stand-alone utility that 
compiles a CADL file and produces a binary version of that file. Binary 
files are executed and run two to four times faster, are smaller, and if 
other files are used (CHAIN, DOSUB, #INCLUDE files), they are all 
compacted into a single file.  

If the file doesn't contain any compiler specific commands or any 
compiler directives, the file just gets compiled into its binary version.  
However, if there are compiler specific commands in your code, CCOMP 
first preprocesses the file into a version that doesn't have any compiler 
specific code in it.  Then this new file is compiled into its binary form.  

If your program doesn't contain any compiler specific commands or 
compiler directives, you can use a .cdl file extension.  If it contains either 
of these, you must use a .cdp extension.  A file with a .cdp file extension 
is preprocessed before it is compiled, while a .cdl file is compiled without 
the preprocessing phase.  Keep in mind, however, if your program uses 
other files, through CHAIN or DOSUB, and some of these files need to be 
preprocessed while some don't, you must use a .cdp extension on all of 
them.  This is because CCOMP assumes the extensions of all subroutine 
files are the same as the input file.  After a file is compiled, it is given a 
.cdx file extension.

When CCOMP preprocesses a .cdp file, it actually creates a .cdl file 
which is then compiled.  This .cdl file will function the same as the .cdp 
file.  The only difference is that any compiler specific commands will be 
converted to non-compiler specific code and any compiler directives will 
be replaced by the code they represent.  Normally CCOMP will delete 
this intermediate .cdl file after the .cdx file is create, but you can save it 
through the use of various options.  


CCOMP Files 

To compile CADL files, you need two executable files, CCOMP.EXE and 
CCOMP1.EXE, and one text file, CCOMP.TXT.  Although the two 
executable files can be either in the current working directory or in a 
directory accessible by the system path, the text file must be in the 
current working directory.  CCOMP is the file you call to compile a 
program.  CCOMP1 is used by CCOMP for various compiler functions 
and the text file contains error messages and a command option 
summary.  


Using CCOMP

The command line usage of CCOMP is:


ccomp [ -CLMNPXdklsu -Bpath -Dcnst[=def] -Idir -nd -ns ] ifile [ ofile ]


The only required parameter is ifile, the input file.  This is the file that 
contains the code to be compiled.  This file must have either a .cdl or .cdp 
file extension.  If the file has any compiler specific commands or any 
compiler directives, it must have a .cdp extension.  If no extension is 
included in the filename, a .cdp extension is assumed.  Any references to 
CHAINed or DOSUBed files are assumed to have the same extension as 
the original input file.

Command Line Options

 XE "compiler command line options" The following options can appear 
in any order within the command line.  If you are using more than one 
option that has no parameters (i.e., -C, -L, etc.), then these can be 
combined behind one dash.  For example:

ccomp -L -X -ns -nd -s myfile

can be also written as:

ccomp -LXnsnds myfile

If you are using the options with parameters included (i.e., -Bpath, -Idir, 
etc.), each option must have a dash in front of it.  For example:

ccomp -Bc:\cdl -Ic:\cdl\include -Ddebug

The optional command line parameters are as follows:

-Bpath 	Specifies the path of the base directory.  The base 
directory is where CCOMP will search for any 
CHAINed or DOSUBed file which has no path 
given.  If there is a partial path, it will assumed 
to be a directory off the base directory.  If "." or 
".." are used in the partial path, the path is then 
relative to the file containing the CHAIN or 
DOSUB statement. Only one -Bpath option can 
be included on the command line.

-C 	When this parameter is included, the 
preprocessor phase is skipped and only the 
compiler phase is used on the input file.  This 
can be used if there are no compiler specific 
commands or directives in your code.  CCOMP 
forces a .cdl extension on the input file when this 
option is used. 

-Dcnst[=def]	This functions as a #define directive except 
instead of only being defined within the file that 
it appeared in, this constant is defined in all files 
that are part of the compilation.  Like the 
#define directive, it can be used to define the 
constant with an actual value, or it can merely 
say that a particular constant is defined (see 
#DEFINE).

-d 	This will cause CCOMP to delete the 
intermediate .cdl files that are create by the 
preprocessor while compiling .cdp files.  This 
option is on by default if the source file is a .cdp 
file, and is off by default if -C, -M, -P, or -u are 
set.  This default can be overridden by -s.

-Idir 	Specifies the path of an include directory.  The 
include directory is where CCOMP will search 
for any files that are #INCLUDEd when no path 
or a partial path is given.  If there is a partial 
path, it will be assumed to be a directory 
branching off the include directory.  If "." or ".." 
are used in the partial path, the path is relative 
to the file contain the #INCLUDE directive.  You 
can have more than one include directory, but 
they will be searched in the order that they are 
given on the command line.

-k 	If there are kanji character strings in your code 
and this option is set, they will be treated as 
kanji characters.  If this is not set, they will be 
interpreted as normal characters.
-L 	When the preprocessor converts various loop 
commands (FOR, DO...WHILE, etc.), it creates 
various labels for the intermediate .cdl file.  All 
these labels being with the '$' character.  This 
option will list all of these $labels and give the 
total number of labels created.  This is useful 
since if you set the number of labels in the 
CONFIG utility to a number lower than the 
number of labels created within your code, your 
program will not run in CADKEY.  When the 
preprocessor interprets a SWITCH statement, it 
also creates a local variable for internal use.  
This option will also list the name of this local 
variable. (This option only works in the 
preprocessor phase.)
 
-l 	During the compiler phase, this option will all 
the variables used in your program, including 
variables created by the preprocessor.  If you use 
any CHAINs or DOSUBs, those files will also be 
listed with their own variable usage list.

-M 	When the preprocessor encounters any of the 
compiler specific commands in a .cdp file, by 
default it replaces them with a functional copy 
of the command in .cdl format.  By using this 
option, your original will also be left in the .cdl 
file, but it will all be in REM statements. By 
default, the -s option is automatically set.

-N 	This will cause the preprocessor to process only 
the input file specified.  CHAINed or DOSUBed 
files will not be preprocessed with this option 
set. (This option only works if the -P option is 
set.)

-nd 	By default, CCOMP will perform an 
optimization that will compact all occurrences 
of repeated data.  Unfortunately, this 
optimization uses CADKEY's shell memory.  
When a program is compiled and uses more 
than 25k of shell memory, a warning will be 
displayed.  If you have memory restrictions and 
do not wish to use this optimization, make sure 
this option is set.

-ns 	This is identical to the -nd option except that the 
optimization is on duplicated strings.  To turn 
off this optimization, include this option in the 
command line.

-P 	This causes CCOMP to run only the preprocessor 
on the input file.  All CHAINed and DOSUBed 
files will also be preprocessed but not compiled.  
The input file must have a .cdp extension.

-s 	This option forces CCOMP to save the 
intermediate .cdl files that it creates from .cdp 
files.  This option is on by default if -C, -M, -P, or 
-u is set, or if the source is a .cdl file. The -d 
option will override these defaults.

-u 	When CCOMP preprocesses a file that has 
CHAIN or DOSUB statements, it normally 
preprocesses every single CHAINed or 
DOSUBed file.  With this option set, the 
preprocessor will only preprocess those files that 
have not been modified since the last time their 
.cdl files were created.  This option will only 
work if you previously have kept the 
intermediate .cdl files, since it compares the 
time/date stamp of the .cdl file with the .cdp 
file.  If the time/date stamps are the same, it will 
not reprocess the .cdp file.  
  
-X 	When CCOMP normally processes a .cdp file to 
.cdl file, it inserts #line statements into the .cdl 
file which reference back to the .cdp file.  Since 
compiler specific commands are converted into 
.cdl format, the line references in the .cdl file 
usually don't correspond to the same lines in the 
original .cdp file.
	These #line statements tell the compiler where it 
would be in the .cdp file, so if an error is 
encountered, it will give the line that the error 
occurred on in the .cdp file.  If you do not wish 
these #line statements to be included within the 
.cdl file, set this option.  Note, however, if any 
error occurs, the line on which the error was 
encountered will refer to the .cdl file.  

ofile	Normally, when CCOMP creates the .cdx output 
file, it simply uses the input file name and 
changes the extension to .cdx.  If you wish a 
totally different name for the output file, include 
it in the appropriate position in the command 
line.  


As CCOMP runs, the filename of the CADL file it is currently processing 
is output to the screen. If any CHAIN or DOSUB commands are parsed, 
the specified filename is saved in a list. Once processing of ifile is 
complete, each file in the list is preprocessed. This continues until all
files called by CHAIN or DOSUB commands have been resolved. Note that 
unless a filename contains full directory pathname, the directory path 
for ifile is used.

When CCOMP detects an error, a message is output that specifies the 
type of error and (usually) the line number at which the error occurs. For 
most errors, processing terminates immediately; for others, processing 
continues. In either case however, no output file is generated.

The command  ccomp -?? will display the following summary of all of 
these options:

Usage: ccomp [ -CLMNPXdklsu -Bpath -Dcnst[=def] -Idir -nd -ns ] ifile [ 
ofile ]
    -Bpath 	 path of base directory
    -C      	compiler phase only
    -Dcnst  	define a constant
    -Idir  	 include file directory
    -L      	list $label and switch variable usage (preprocessor phase)
    -M     	mixed output to .cdl files
    -N     	no linking to chain/dosub files (only if -P set)
    -P     	preprocessor phase only
    -X     	exclude #line references to .cdp files in .cdl files
    -d      	delete .cdl files (default if -C -M -P and -u NOT set and 
source is .cdp file; -s overrides default)
    -k      	process kanji characters
    -l      	list variable usage (compiler phase)
    -nd     	no double data optimization
    -ns     	no string data optimization
    -s      	save .cdl files (default if -C -M -P or -u set or source is .cdl 
file; -d overrides default)
    -u      	update mode
    ifile   	input file (.cdp or .cdl forced)
    ofile  	output file (.cdx forced)




Compiler Directives
The following pages describe the various options for the preprocessor 
phase of the CADL compiler. To use these directives, your CADL file 
must have a .cdp extension instead of a .cdl extension and it should be 
run through the CCOMP utility before execution.

To direct the preprocessor to replace identifiers with their definitions, 
you will need to use the #DEFINE XE "#DEFINE"  directive.  You can 
also use the #DEFINE directive just to say that a particular identifier has 
been defined, even if it is not going to be replaced by any particular 
definition.  This second use of #DEFINE is only useful when using either 
of the directives, #IFDEF XE "#IFDEF"  or #IFNDEF XE "#IFNDEF" .  
These directives control whether or not a particular section of code is to 
be compiled.  

#IFDEF compiles the code if the specified identifier has been defined, 
while #IFNDEF compiles the code only if the identifier has not been 
defined.  Note that the identifier doesn't necessarily have to have a 
definition, it just has to be defined.  

To disassociate an identifier with its definition, use the #UNDEF XE 
"#UNDEF"  directive. You can use this directive to un-define an 
identifier you previously defined, or to make sure an identifier was not 
defined previously in another section of the program. 

To insert the contents of another file into the current program, use the 
#INCLUDE XE "#INCLUDE"  directive. 

#DEFINE

The #DEFINE directive is used to assign an identifier to substitution-text. 
All free-form occurrences of the identifier in the .cdp file are replaced by 
the substitution-text. However, if the identifier is part of a longer word or 
is enclosed within a quoted string, it is not replaced. The identifier must 
follow the same naming convention as variables. 

The substitution-text can consist of any valid CADL statement or 
command. It is separated from the identifier by at least one white-space 
character (white-space characters following the last word of the 
substitution-text are not considered part of it). Substitution-text can also 
be empty.

Format:
#DEFINE XE "#DEFINE"  identifier substitution-text


#IFDEF, #IFNDEF

The #IFDEF and #IFNDEF directives are used to selectively compile 
portions of code, depending on whether or not the identifier has been 
defined. Every #IFDEF or #IFNDEF must have a corresponding 
#ENDIF XE "#ENDIF"  directive to mark off the code block for 
conditional compilation.

If the identifier specified in the #IFDEF directive is defined with either a 
#DEFINE directive or the runtime compiler option -D, then the 
statements in code-block 1 are considered part of the source code to be 
compiled.

If the identifier does not have a definition, the statements in code-block 2  
(following the #ELSE directive) are included in the code to be compiled. 
The #ELSE XE "#ELSE"  directive is optional and can be omitted. In this 
case, the code block between #IFDEF and #ENDIF directives are 
compiled if the identifier is defined, and ignored if the identifier is not 
defined.

The #IFNDEF directive works the opposite way. It compiles a code block 
if the identifier does not have a definition, or if it is removed with an 
#UNDEF directive before reaching the conditional. If there is an #ELSE 
directive between #IFNDEF and #ENDIF, the code block following 
#ELSE is compiled if the identifier is defined.


Format: XE "#IFDEF"  XE "#IFNDEF" 
	#IFDEF identifier		#IFNDEF identifier
		.  			.
		.  			.
		code-block 1    			code-block 1
		.	  		.
		.  			.
	[#ELSE	OR	[#ELSE
		. 	  		.
		. 	  		.
		code-block 2   			code-block 2
		.	  		.
		. ]    			]
	#ENDIF  		  #ENDIF




#DEFINE DEBUG


at the beginning of the program or using the -DDEBUG option with the 
compiler at runtime. When the PAUSE command is no longer needed, 
these options can be removed for compilation without the debugging 
code. Notice that the actual definition of the DEBUG identifier is not 
important for the #IFDEF directive.
#INCLUDE

The purpose of the #INCLUDE directive is to insert the contents of the 
file specified by the file-spec in a source file. The file-spec can optionally 
contain a drive letter and path for the file. Any valid DOS filename can 
be used for the include files. The following rules should be followed 
when searching for he file to be included:

1.	If the file-spec consists of a filename, the preprocessor looks for 
the include file in the directory of the source file.

2.	If the file-spec contains a relative path, the preprocessor looks for 
the include file under the given path, relative to the directory of 
the source file.

3.	If the file-spec contains an absolute path, the preprocessor looks 
for the include file under that path.

Additional paths for include files can be specified with the -I compiler 
option at runtime. These directories are searched, in the order in which 
they are specified, only if the include file is not found under the given 
file-spec. The search terminates at the first location of the include file.

The preprocessor replaces the #INCLUDE directive in the source file 
with the entire contents of the include file. The include files generally 
contain #DEFINE directives that need to be available globally.


Format:
#INCLUDE XE "#INCLUDE"  file-spec

#UNDEF

The #UNDEF directive is used to disassociate the identifier with its 
current definition. After the #UNDEF directive, any subsequent 
occurrences of the identifier are not translated by the preprocessor.

The #UNDEF directive can also be used on an undefined identifier to 
make sure that it no longer has a definition.

The #UNDEF directive is generally used in conjunction with the 
#DEFINE directive indicating that a certain identifier is available only in 
a certain section of code.


Format:
#UNDEF XE "#UNDEF"  identifier


Compiler Specific Commands
The commands on the following pages can only be used in programs that 
are going to be compiled using the CCOMP utility.


IF...ELSE IF...ELSE XE "IF...ELSE IF...ELSE" 

The first difference between this compiler statement and the uncompiled 
IF statement is that instead of only being able to execute one statement if 
the expression is true, you can now execute a group of statements, 
surrounded by brackets {}.  

To execute one set of commands if a test condition is true and another 
set if it is false, you can use an IF...ELSE construction.

To choose from multiple sets of commands, you can add as many 
ELSE...IF clauses as is necessary.  


Loop Statements

If you have tried to create various types of loops in an uncompiled 
CADL program, you have probably noticed that it can get quite messy, 
with what appears to be a maze of IF's, GOTO's, and labels.  The 
following statements allow you to easily construct loop structures in 
compiled programs. 

The FOR XE "FOR"  statement provides a means to loop through a set of 
commands, with control over the initialization of the loop, a test 
condition, and any loop variables.

The WHILE XE "WHILE"  statement provides a loop mechanism which 
evaluates an expression before every iteration of the loop.  If the 
expression is true, the commands in the loop are executed. The loop 
terminates when the expression becomes false.  

The DO...WHILE XE "DO...WHILE"  statement executes in a similar 
fashion as the WHILE XE "WHILE"  statement except that the test 
condition is evaluated after every iteration of the loop.

The SWITCH XE "SWITCH"  statement executes a group of commands 
based on the value of an expression.  

The CONTINUE XE "CONTINUE"  statement used in a loop will cause 
the next iteration of the loop to begin.  In a FOR loop, the execution 
continues with the expression that increments or decrements the loop 
variable.  In the WHILE and DO...WHILE loops, the execution continues 
with the evaluation of the test condition.  

The EXITLOOP XE "EXITLOOP"  statement in a FOR, WHILE and 
DO...WHILE loop terminates the execution of that loop.  If the loop is 
nested inside another loop, the execution of the outer loop is not 
affected.


LOCAL

LOCAL XE "LOCAL"  provides a means of indicating that certain 
variables are to be used only in the currently running CADL program 
and may not be accessed by other programs.  
/* comment string */

/* ... */  identifies remarks. These characters, as well as any text included 
between them, are ignored by the system when a CADL file is executed.  
This can also be used to temporarily prevent a section of code from being 
compiled.


Format:
/* comment string */ XE "comments:in compiled programs"  
 

The CONTINUE statement is used to initiate the next iteration of a 
DO...WHILE, FOR or WHILE loop, skipping any remaining statements in 
the body of the loop.

When a CONTINUE statement is encountered in a FOR loop, the 
program control is transferred to the iteration expression of the loop to 
increment or decrement the loop variables. After that, the test condition 
for the loop is evaluated. If it is true (nonzero), the next iteration of the 
loop starts. If the test condition is false, the loop terminates. 

In a DO...WHILE or a WHILE loop, the CONTINUE statement transfers 
the program control to the evaluation of the test condition of the WHILE 
clause. If the result is true, the next iteration of the loop is started. If it is 
false, the loop terminates. 


Format:
CONTINUE XE "CONTINUE" 


DO ... WHILE

The body of the DO ... WHILE loop (enclosed within the braces) is 
executed in each pass. At the end of the pass, the expression for the 
WHILE statement is evaluated. If the expression is false (zero), the loop 
terminates and the program continues with the statement following the 
loop. If the expression is true (non-zero), the whole process repeats.

If the statement block consists of only one statement, it does not have to 
be enclosed in braces.


Format:
	DO XE "DO...WHILE" 
		{
		.
		.
		statement-block
		.
		.
		} WHILE (expr)



This program segment only proceeds from the menu when either YES or 
NO is selected. Escape, Backup and Enter will not break this loop.
EXITLOOP

The EXITLOOP statement is used to break out of a loop during any of its 
iterations. When an EXITLOOP statement is encountered in a 
DO...WHILE, FOR or WHILE loop, the program skips any remaining 
statements in the body of that loop and continues execution with the 
first statement following that loop. 

If an EXITLOOP statement is executed in a loop that is nested within 
another loop, only the inside loop is terminated and the program 
continues with the outer loop. 


Format:
EXITLOOP XE "EXITLOOP" 

FOR

A FOR loop is used to execute a statement block a fixed number of times 
using the optional expressions expr1, expr2, and expr3 to control the 
initialization, test, and iteration, respectively.

In a FOR loop, expr1 is evaluated first. This expression is typically used 
to assign initial values to loop variables. It can be left out if there are no 
loop variables to initialize.

Expr2 is the test condition for the loop. It is evaluated before the body of 
the loop is executed. If the result is false (zero), the statements in the 
body of the loop (enclosed in braces) are skipped and the program 
continues with the first statement following the FOR loop.

If expr2 is true or it is omitted, the statement block (enclosed within the 
braces) is executed. Expr3 is then evaluated to increment or decrement 
any loop variables. This expression can also be omitted.
If the statement block consists of only one statement, it does not have to 
be enclosed in braces.  


Format:
	FOR  XE "FOR " ([expr1];  [expr2];  [expr3])
		{
		.
		.
		statement-block
		.
		.
		}


In the IF ... ELSE IF ... ELSE statement, the expression, expr, following the 
IF clause is evaluated first. If the expression is true (nonzero), the 
statements (enclosed within the braces) in the statement-block following 
the IF clause are executed. The program then continues with the 
statement following the compound IF statement. 

If the expression, expr, is false (zero), the program evaluates the 
expressions after the succeeding ELSE IF clauses. When an ELSE IF 
statement with a true expression is found, the statement-block following 
that ELSE IF clause is executed. The program then continues with the 
first statement following the compound IF statement.

If no ELSE IF clause has a true expression, the statements enclosed 
within the braces in the statement-block following the ELSE clause are 
executed. The program then continues with the statement following the 
compound IF statement.

The ELSE IF and ELSE clauses in the compound IF statement are not 
mandatory. A compound IF statement can consist of only an IF and one 
or more ELSE IF clauses, an IF and an ELSE clause, or just an IF clause. If 
an ELSE clause is used, it must be the last clause of the compound IF 
statement. The execution for the clauses used remains the same.

If the statement-block following any clause consists of only one 
statement, it does not have to be enclosed in braces. 

Format:
	 XE "IF...ELSE IF...ELSE" IF (expr)
		{
		statement-block
		}
	[ ELSE IF (alt-expr)
		{
		statement-block
		} ]
	[ ELSE
		{
		statement-block
		} ]


LOCAL

LOCAL provides a means of indicating that certain variables are local to 
the currently running CADL program and may not be accessed by other 
programs. Multiple LOCAL statements may be specified but they must 
occur before the first executable statement in the program (/*...*/ and 
REM statements are not executable). 


Format:
	 LOCAL  XE "LOCAL " var1, var2, ...


SWITCH

The SWITCH statement uses a computed value to transfer program 
execution to a section of its body (enclosed within the braces).

First, the expression expr following the SWITCH clause is evaluated. The 
resulting value is compared with the constant expressions (const-expr) 
after each of the CASE clauses. The program control is then transferred 
to the statement following the first CASE clause that matches this value.

If no match is found, and there is a DEFAULT clause, the statement-
block following DEFAULT is executed. If the DEFAULT clause is omitted 
and no match is found, the whole body of the SWITCH statement is 
skipped and the program continues with the first statement after the 
SWITCH statement.

If two constant expressions separated by a colon (low:high) follow the 
CASE clause instead of just one constant expression, the value of the 
expression expr is checked to be within the range of these numbers. The 
first number must be the lower bound for the range and the second 
number must be the upper bound for the range. 

Each statement block can be optionally terminated by a BREAK clause. 
When a BREAK clause is met at the end of the statement block, the 
program skips over the rest of the SWITCH statement body and 
continues execution with the first statement that follows it.

If a statement block is not terminated by the BREAK clause, execution 
continues with the statement block belonging to the next CASE or 
DEFAULT clause.  A SWITCH statement can contain any number of 
CASE clauses. The body of the SWITCH statement MUST be enclosed by 
braces.

Format:
	 XE "SWITCH" SWITCH (expr)
		{
		CASE const-expr
			statement-block
			[ BREAK ]

		[ CASE low:high
			statement-block
			[ BREAK ]
	 		 ]

		[ DEFAULT
			statement-block ]
		}

WHILE

The body of the WHILE loop is executed as long as the expression (expr) 
after the WHILE statement is true. In each pass, the expression is 
evaluated. If the expression is false (zero) the statement-block (enclosed 
by braces) is skipped and the program continues with the first statement 
following the loop. If the expression is true (non-zero), the statement-
block is executed and the whole process is repeated.

If the statement-block consists of only one statement, it does not have to 
be enclosed in braces. 


Format:
	WHILE  XE "WHILE " (expr)
		{
		.
		.
		statement-block
		.
		.
		}




______________________________________________________________________________

APPENDICES 

This section contains supplemental information which is referenced 
within the CADL documentation. 

APPENDIX I: 	CADL Error Messages	
APPENDIX II: 	System Arrays	
APPENDIX III: 	Entity Information	

APPENDIX I: CADL Error Messages
 XE "Error Messages" Listed below are some of the error messages you 
may encounter in a CADL program and a short explanation of each.


Arg #NUM bad or missing

A statement argument is either incorrectly specified or is missing. 
"NUM" is the argument number.

Array doesn't match declaration (NAME)

The array declaration specified for a READ or WRITE statement 
doesn't match the actual declaration. "NAME" is the array name.
 
Bad argument count
 
The statement contains either too few or too many arguments.

Bad CDE prototype (arg #NUM)
 
The argument of a CDE function is not as defined. Check syntax.

Bad dimensions for array 'NAME'

The dimensional information for array "NAME" contains either a 
syntax error or an invalid expression.

Bad format for NAME, Expected STRING 

The format of the data specified for array "NAME" is incorrect. 
"STRING" is "{" or "}" if either of those characters is misplaced or 
missing. STRING is "less data" if more data than the array can 
hold is provided.

Bad or missing CODE command

An attempt has been made to run a CADL file that either does 
not have a CODE command or has the incorrect CODE for the 
current security code in effect. Either change the security code 
(secure.dat) or add the correct CODE command to the CADL file.

Bad or missing data arg

The data file accessed by a READ statement contains invalid data 
or a null field.

Bad or undefined label (LABEL)

An attempt has been made to go to a label that is illegal or 
undefined.

Bad string variable (arg #NUM)

The variable to be substituted for the string argument NUM is 
invalid.

Bad syntax

The statement contains a syntax error.

CADL array 'NAME' is already defined

An attempt has been made to assign array "NAME" as a non-
array variable or vice versa.

CADL array 'NAME' is too large or has bad dims

The size of the array "NAME" is too large. Reduce the size of the 
array.

CADL program needs NUM1K of system memory (NUM2K available)

The CADKEY system buffer is too small to run the binary CADL 
file. Increase the size of the system buffer by the difference of 
NUM1 minus NUM2.

CDE argument type not supported (arg #NUM)

The data type for the argument is not supported. Check the 
argument type.

CDE Errors

Errors in CDE call.

Can't chain to 'FILE'

Could not chain to file "FILE". Insure that the file specification is 
correct and that the file exists.

Can't make system variable 'NAME'

System variables are read-only; they may not be created. "NAME" 
is the variable name.

Can't make var 'NAME' (file create error)

The file containing CADL array data cannot be created. "NAME" 
is the array name. Array data is stored in a file called "vars.dat" 
which is created in the database directory. Check that the 
directory exists and has room for the file.

Can't make var. 'NAME' (too many vars)

The CADL variable table has overflowed. "NAME" is the variable 
that caused the overflow. Increase the number of allowed CADL 
variables.

Can't open data file (FILE): too many files

The specified data file "FILE" could not be opened. Either open 
fewer files or close some so that others can be opened.

Can't output part: too many views

The part contains too many views to be output as one CADL file. 
Break up the part into smaller parts and output separately.

Can't read into undeclared array (NAME)

An attempt has been made to read data into an undefined array 
variable. "NAME" is the array name.

Can't read/reopen/reposition CADL file FILE

An error has occurred while attempting to access the file "FILE".

Can't run CADL (bad or missing security code file)

The security code file (secure.dat) is either missing or is incorrect 
for the CADL file to be run.

Can't run CADL file: wrong version

The binary CADL file is either corrupt or was compiled using an 
incompatible version of CCOMP.

Can't set up CADL input

An error involving the CADL input stream has occurred during 
initialization.
 
Can't set up CADL output

An error involving the CADL output stream has occurred during 
initialization.
 
Can't write 'NAME'
 
CADL is unable to write to the file 'NAME'. Check that enough 
space is available on the disk for the file.

Computed GOTO syntax error

The ON/GOTO statement contains a syntax error.

DOSUB nest overflow

The number of allowed nested CADL files has been exceeded.

Duplicate label or overflow (LABEL)

The label "LABEL" has been previously defined or too many labels 
have been specified. Either change the label name or increase the 
number of allowed CADL statement labels.

Illegal default usage (arg #NUM)

A parameter for which no default is allowed has been specified as 
a null field (i.e., set default value). "NUM" is the parameter 
number.
 
Illegal view number (NUM)

The view number "NUM" is out of range.

Insufficient data for NAME

The array specified in the primitive statement contains an 
insufficient amount of data. "NAME" is the primitive type.

Invalid CDE File

An invalid CDE  file has been opened. 

Invalid expression 'EXP'

An invalid expression has been detected. "EXP" is the illegal 
expression.

Local var. stack overflow, req'd: NUM1, avail: NUM2

CADL has run out of variable entries for the local variable stack. 
NUM1 is the number of required variables, NUM2 is the number 
available. Increase the number of allowed CADL variables.

Parentheses mismatch (arg #NUM)

Argument number "NUM" is missing a matching parenthesis. All 
non-string arguments must have an equal number of opening 
and closing parentheses.

Premature EOF on IF

While processing an IF statement that has a false logical value, 
the end of the file has been reached before all true statements 
could be skipped.

Record overflow

The statement being parsed has overflowed the buffer. Simplify 
the statement.

String overflow 

Text string(s) too long. The total number of characters for text 
strings exceeds allowable storage. Shorten strings.

String variable 'NAME' not 1-dimensional

An attempt has been made to create string variable NAME with 
either no dimensions or more that one dimension.

Unknown CALL function (NAME)

The function "NAME" specified for the CALL command is 
undefined.

Unknown command (NAME)

The function "NAME" specified for the command is undefined.

Unknown mode (MODE) 

The specified mode "MODE" is not one of the keywords 
"NORMAL", "DRAW", or "SUPPRESS".

Unknown view number (NUM) specified

An illegal view number has been specified. "NUM" is the illegal 
view number.

Unrecognized SET option

An invalid SET keyword has been specified.
 
Variable 'NAME' undefined

The specified variable "NAME" is undefined.

Variable not declared (arg #NUM)

A variable specified in a WRITE statement is not declared. 
"NUM" is the argument number of the variable.




APPENDIX II: System Arrays

When an entity is selected, it fills up various system arrays XE "System 
Arrays" . Depending on the entity type, the sizes of these arrays may 
change. A system variable is attached to some of the system arrays. 
These variables contains the size of the system array it has been attached 
to.

There are 3 universal arrays: @INTDAT, @FLTDAT, and @MSCDAT. If a 
dimension entity, note or label is selected, several other arrays get filled 
up such as @DIMINFO1, @DIMINFO2, @TXTATT, etc. This section 
contains descriptions of all the arrays. The system arrays are as follows:

@DIMINFO1 An array of  flag settings and integer values that are 
used for dimension entities
@DIMINFO2 An array of float values that are used for dimension 
entities
@ENTATT	An array of values that are use for dimension entity 
attributes
@FLTDAT	An array containing float data for an entity
@INTDAT	An array containing integer data for an entity
@LDRLN	An array containing data for leader lines
@MSCDAT	An array containing miscellaneous data
@REFARC	An array containing data for reference arcs
@REFLN	An array containing data for reference lines
@REFPNT	An array containing data for reference points
@STRDAT	An array of characters
@TXTATT	An array containing attribute information for the text
@TXTINFO  An array containing display information for the text
@WITLN	An array containing data for witness lines


The system variables relevant to the system arrays are as follows:

@NUMINT	Number of values in the @INTDAT array
@NUMFLT	Number of values in the @FLTDAT array 
@NUMSTR	Number of values in the @STRDAT array


@DIMINFO1

DIMINFO1  XE "DIMINFO1 " is an array of flag settings and integer 
values that are used for dimension entities. Some fields are reserved for 
future use.

@DIMINFO1[0]	This field is reserved for future use

@DIMINFO1[1]	Witness lines to be displayed:
	0 = Both witness lines to be displayed
	1 = First witness line to be displayed
	2 = Second witness line to be displayed
	3 = No witness lines to be displayed

@DIMINFO1[2]	Leader line styles:
	0 = Both leader lines
	1 = First leader line
	2 = Second leader line
	3 = No leader lines
	4 = Solid leader line
	5 = First leader line to be solid
	6 = Second  leader line to be solid
	7 = No arrows

@DIMINFO1[3]	Direction of arrows:
	0 = Arrows inward
	1 = Arrows outward

@DIMINFO1[4]	Dimension mode (the system of measurement):
	2 = Decimal system (e.g.  0.3, 13. 523, etc. )
	3 = Fractional system (e.g.  3/4, 1/2, etc.)
	4 = Feet and inch system
	5 = Degrees. This is useful only for angular measurements
	6 = Degree, Minutes and Seconds system

@DIMINFO1[5]	Dimension units:
	0 = Inches
	1 = Millimeters
	2 = Feet
	3 = Centimeters
	4 = Yards
	5 = Meters
	6 = Degrees

@DIMINFO1[6]	Tolerance type:
	0 = No tolerance
	1 = +/- tolerance values in 2 lines
	2 = Limits
	3 = +/- values in 1 line
	4 = +/- values in 2 lines. Top only for dual 
dimensioning
	5 = +/- values in 2 lines  Bottom only for dual dimensioning

@DIMINFO1[7]	Single line tolerance flag:
	0 = DO NOT display the + and -  tolerance in one line (if equal)
	1 = Display the + and - tolerance value in one line (if equal)

@DIMINFO1[8]	ASCII value of the decimal character.  It is 46 for '.'

@DIMINFO1[9]	Text position flag:
	0 = Solid leaders NOT used. Text will be above leader
	1 = Solid leaders used. Text will be below leader

@DIMINFO1[10]	Flag for automatic center dimension:
	0 = DO NOT center the dimension automatically
	1 = Automatically center the dimension

@DIMINFO1[11]	Dimension text alignment flag:
	0 = Text is horizontal
	1 = Text is aligned with leader lines
	2 = Text is at some angle to leader lines (other than horizontal)

@DIMINFO1[12-13]	Reserved for future use. Current system value is 0. 

@DIMINFO1[14]	A flag to display zero tolerance value with or without  
                +/- signs:
	0 = DO NOT display sign
	1 = Display the sign

@DIMINFO1[15]	A flag for trailing zeros in dimension value:
	0 = Ignore the trailing zeros
	1 = Keep trailing zeros

@DIMINFO1[16]	A flag for leading zeros in dimension value:
	0 = Ignore the leading zeros
	1 = Keep leading  zeros

@DIMINFO1[17]	Number of decimal places for dimension value:
	0 to 7 - Places after decimal

@DIMINFO1[18]	Arrow style for the dimension
	0 = Style 1
	1 = Style 2
	2 = Style 3
	3 = Style 4

@DIMINFO1[19-31]	Reserved for future use. Current system value is 
0. 

@DIMINFO2

DIMINFO2  XE "DIMINFO2 " is an array of float values that are used for 
dimension entities.

@DIMINFO2[0]	Witness line gap factor. When this factor is 
multiplied by the dimension height, it results in 
the distance (gap) between a witness line and its 
reference point.

@DIMINFO2[1]	Arrowhead gap factor. When this factor is 
multiplied by the dimension height, it results in 
the rise that a witness line makes above the 
leader line.

@DIMINFO2[2]	Scale for the dimension text value.

@DIMINFO2[3]	Roundoff factor when the unit of the dimension 
is fraction or feet and inches.

@DIMINFO2[4]	Scale used for the top of dual dimension.

@DIMINFO2[5]	Scale used for the bottom of dual dimension.

@DIMINFO2[6]	Positive tolerance value.

@DIMINFO2[7]	Negative tolerance value.

@DIMINFO2[8]	Angle of witness line. The angle to sheer 
dimension by.

@DIMINFO2[9]	Scale factor used when displaying dual 
tolerances.

@ENTATT

ENTATT  XE "ENTATT " contains all the attribute information for a 
dimension entity.
	
@ENTATT[0]	Construction view for view-dependent entities
	Long value - Construction view number	

@ENTATT[1]	Color assigned to the entity
	0 to 15 - Color number in system palette	

@ENTATT[2]	Color for filled polygons or filled polylines
	0 to 255 - Fill color	

@ENTATT[3]	Pen number assigned to the entity
	1 to 8 - Pen number	

@ENTATT[4]	Level number assigned to the entity
	1 to 256 - Level number	

@ENTATT[5]	Line type for the entity
	1 to 4 - Line type number	

@ENTATT[6]	Line width for the entity
	1 to 15(odd) - Line width	

@ENTATT[7]	Entity group reference number
	1 to 127 - Group number assigned	
	0 - No group assignment	

@ENTATT[8]	Entity subgroup reference number
	1 to 256 - Subgroup number assigned	
	0 - No subgroup assignment	
	
@FLTDAT

The FLTDAT  XE "FLTDAT " array contains float data for the entity.  The 
system variable @NUMFLT  XE "NUMFLT " contains the size of the 
FLTDAT array.  All entities fill this array with various data.

The detail entities such as Linear dimension, Circular dimension,  
Ordinate dimension, Angular dimension, Note, File note and Label fill 
this array with the following data:


@FLTDAT[0]	X coordinate of text in view coordinate system
@FLTDAT[1]	Y coordinate of text in view coordinate system
@FLTDAT[2]	Z coordinate of text in view coordinate system


Linear and Ordinate dimensions fill FLTDAT with these three elements 
plus a fourth one:


@FLTDAT[3]	Angle of dimension axis (in radians)



The Leader entity has only one float data while the Witness entity does 
not have any float data.


@FLTDAT[0]	Depth of arrow (for Leader entity only)

@INTDAT

The INTDAT  XE "INTDAT " array contains integer data for the entity.  
The INTDAT array can have different sizes for different entities.  For 
more detail refer to the Entity Information section.  The system variable 
@NUMINT  XE "NUMINT " contains the number of integers in the 
INTDAT array.


@LDRLN

A  LDRLN  XE "LDRLN " array contains information about leader lines.  
The leader lines are used for dimensions and leader entities.  For each 
leader line there are 17 values.  The first subscript in the array represents 
the leader line number.

@LDRLN[0][0]	X coordinate of first endpoint of leader line in 
view coordinate system

@LDRLN[0][1]	Y coordinate of first endpoint of leader line in 
view coordinate system

@LDRLN[0][2]	X coordinate of second endpoint of leader line in 
view coordinate system

@LDRLN[0][3]	Y coordinate of second endpoint of leader line in 
view coordinate system

@LDRLN[0][4]	Line type assigned to leader line
	1 to 4 - Line type number

@LDRLN[0][5]	Line width assigned to leader line
	1 to 15 (odd) - Line width

@LDRLN[0][6]	Pen number assigned  to leader line
	1 to 8 -  Pen number

@LDRLN[0][7]	Color number assigned to leader line
	0 to 15 - Color number

@LDRLN[0][8]	X coordinate of arrowhead tip in view 
coordinate system

@LDRLN[0][9]	Y coordinate of arrowhead tip in view 
coordinate system

@LDRLN[0][10]	Included angle between the two lines that make 
up an arrowhead tip 

@LDRLN[0][11]	Arrow height

@LDRLN[0][12]	Pattern number
	1 to 4 - Pattern number

@LDRLN[0][13-16]	Reserved for future use. Current system value is 
0.
 
@MSCDAT

The MSCDAT  XE "MSCDAT " array contains miscellaneous information 
about an entity. In the current version, for all entities except GENDIM, 
the array contains only entity ID information.

@MSCDAT[0]	Entity ID



@REFARC

A  REFARC  XE "REFARC " array contains information about reference 
arcs.  For the current version the reference arc is used for circular 
dimensions only.  For each reference arc there are five values.  The first 
subscript in the array represents the reference arc number.

@REFARC[0][0]	X coordinate of center of 1st reference arc in 
view coordinate system
@REFARC[0][1]	Y coordinate of center of 1st reference arc in 
view coordinate system
@REFARC[0][2]	Radius of 1st reference arc
@REFARC[0][3]	Start angle of arc segment (degrees) of 1st 
reference arc
@REFARC[0][4]	Delta angle of arc segment (degrees) of 1st 
reference arc

..
..
@REFARC[n-1][0] 	X coordinate of center of nth reference arc in 
view coordinate system
@REFARC[n-1][1] 	Y coordinate of center of nth reference arc in 
view coordinate system
@REFARC[n-1][2] 	Radius of nth reference arc
@REFARC[n-1][3]	Start angle of arc segment (degrees) of nth 
reference arc
@REFARC[n-1][4]	Delta angle of arc segment (degrees) of nth 
reference arc

@REFLN

A  REFLN  XE "REFLN " array contains information about reference 
lines.  For the current version the reference line is used for linear and 
angular dimensions only.  For each reference line there are four values.  
The first subscript in the array represents the reference line number.

@REFLN[0][0]	X coordinate of first endpoint of 1st reference 
line in view coordinate system
@REFLN[0][1]	Y coordinate of first endpoint of 1st reference 
line in view coordinate system
@REFLN[0][2]	X coordinate of second endpoint of 1st reference 
line in view coordinate system
@REFLN[0][3]	Y coordinate of second endpoint of 1st reference 
line in view coordinate system
..
..
@REFLN[n-1][0] 	X coordinate of first endpoint of nth reference 
line in view coordinate system
@REFLN[n-1][1] 	Y coordinate of first endpoint of nth reference 
line in view coordinate system
@REFLN[n-1][2] 	X coordinate of second endpoint of nth reference 
line in view coordinate system
@REFLN[n-1][3]	Y coordinate of second endpoint of nth reference 
line in view coordinate system

@REFPNT

A REFPNT  XE "REFPNT " array contains information about reference 
points.  For the current version the reference point is used for linear 
dimensions only.  For each reference point there are two values.  A 
maximum of three reference points is available. 

@REFPNT[0][0]	X coordinate of 1st reference point in view 
coordinate system
@REFPNT[0][1]	Y coordinate of 1st reference point in view 
coordinate system

@REFPNT[1][0]	X coordinate of 2nd reference point in view 
coordinate system
@REFPNT[1][1]	Y coordinate of 2nd reference point in view 
coordinate system

@REFPNT[2][0]	X coordinate of 3rd reference point in view 
coordinate system
@REFPNT[2][1]	Y coordinate of 3rd reference point in view 
coordinate system


@STRDAT

The STRDAT  XE "STRDAT " array contains a text string for a detail 
entity.  STRDAT is also used to return text from a dialog box.  For the 
current version the text is used for all detail entities except leader and 
witness lines. The system variable @NUMSTR  XE "NUMSTR " contains 
the size of the STRDAT array.

@STRDAT[0]	First character in the string
@STRDAT[1]	Second character in the string
.
.
@STRDAT[n]	Last character in the string (null)

where n = @NUMSTR - 1.


@TXTATT

A TXTATT  XE "TXTATT " array contains information about attributes of 
the text in a detail entity. For the current version, the text attributes are 
used for all detail entities except leader and witness lines.

@TXTATT[0]	Font number assigned to the note entity
	1 to 16 - Font number

@TXTATT[1]	Fill mode for new style fonts:
	0 = Non-filled text
	1 = Filled text

@TXTATT[2]	Underline mode:
	0 = Non-underlined text
	1 = Underlined text

@TXTATT[3]	Mirror mode:
	0 = Non-mirrored text	
	1 = Mirrored text

@TXTATT[4]	Slant angle, in degrees, for new style fonts
	-31 to 31 - Slant angle

@TXTATT[5]	Rotation angle, in degrees, about the z axis
	0.0 to 360 - Rotation angle

@TXTATT[6]	Character height in world units
	0.0005 to 10000 - Character height

@TXTATT[7]	Character aspect ratio (width/height)
	0.01 to 100 - Aspect ratio

@TXTATT[8]	Line spacing factor
	Any number - Line spacing

@TXTINFO

A TXTINFO  XE "TXTINFO " array contains text information for a detail 
entity.  In the current version, the TXTINFO array is used for all detail 
entities except leader and  witness lines. The TEXTINFO array contains 
six values.

@TXTINFO[0]	A flag to display only in the definition view:
	0 = Display in all views
	1 = Display in view only 

@TXTINFO[1]	Text format.  Only 0 is available in the current 
version.
	0 = Left justified text

@TXTINFO[2]	Proportional spacing mode:
	0 = NOT proportionally spaced
	1 = Proportionally spaced

@TXTINFO[3]	Direction of first to last character in a text string. 
	One option is available in the current version:
	0 = Left to right

@TXTINFO[4]	A flag for the horizontal text alignment:
	0 = Left alignment of text 
	1 = Center alignment of text
	2 = Right alignment of text

@TXTINFO[5]	A flag for the vertical text alignment:
	0 = Bottom alignment of text 
	1 = Center alignment of text
	2 = Top alignment of text 


@WITLN

A  WITLN  XE "WITLN " array contains information about witness lines.  
For each witness line there are eight data.  The first subscript in the array 
represents the witness line number.

@WITLN[0][0]	X coordinate of first endpoint of witness line in 
view coordinate system

@WITLN[0][1]	Y coordinate of first endpoint of witness line in 
view coordinate system

@WITLN[0][2]	X coordinate of second endpoint of witness line 
in view coordinate system

@WITLN[0][3]	Y coordinate of second endpoint of witness line 
in view coordinate system

@WITLN[0][4]	Line type assigned to witness line
	1 to 4 - Line type number

@WITLN[0][5]	Line width assigned to witness line
	1 to 15 (odd) - Line  width

@WITLN[0][6]	Pen number assigned  to witness line
	1 to 8 -  Pen number

@WITLN[0][7]	Color number assigned to witness line
	0 to 15 - Color number


APPENDIX III: Entity Information

 XE "Entity Information" When you select entities in CADL, the 
information is stored in the system arrays.  This section lists 
alphabetically the entity types and the information that is stored in the 
system arrays when they are selected.


The following is a list of entities and their entity type value:

POINT	                1	ANGULAR DIMENSION	14
LINE	                2	NOTE (NNOTE)    	15
ARC\CIRCLE	        3	LABEL (NLABEL)	        16
CONIC	                4	LEADER (NLEADER)        17
SPLINE	                5	WITNESS (NWITNESS)      18
POLYGON	                6	XHATCH                  19
POLYLINE	        7	GENERIC DIMENSION       20
LINEAR DIMENSION	11	ORDINATE DIMENSION      21
CIRCULAR DIMENSION	12	FNOTE (NFNOTE)          22


ANGULAR DIMENSION

 XE "ANGDIM" @NUMINT	Number of values in @INTDAT (9)
@NUMFLT	Number of values in @FLTDAT (3)
@NUMSTR	Length of dimension text (Maximum 1024)


@INTDAT[0]	Entity type (14)
@INTDAT[1]	Group number (1-127 = group number, 0 = 
                none)
@INTDAT[2]	Group instance (1-255 = group instance 
                number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Font number (1-6 = old style number, 0 = 
                font # in @TXTATT[0])
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
@INTDAT[8]	The flag for inner or outer angle:
        	0 = Outer angle
	        1 = Inner angle


@FLTDAT[0]	X coordinate of note in view coordinate system
@FLTDAT[1]	Y coordinate of note in view coordinate system
@FLTDAT[2]	Z coordinate of note in view coordinate system


@DIMINFO1[]	Refer to System Arrays (Appendix II) for details
@DIMINFO2[]	Refer to System Arrays (Appendix II) for details
@ENTATT[]	Refer to System Arrays (Appendix II) for details
@MSCDAT[]	Refer to System Arrays (Appendix II) for details
@REFLN[]	Refer to System Arrays (Appendix II) for details
@STRDAT[]	Refer to System Arrays (Appendix II) for details
@TXTATT[]	Refer to System Arrays (Appendix II) for details
@TXTINFO[]	Refer to System Arrays (Appendix II) for details

ARC/CIRCLE

 XE "ARC"  XE "CIRCLE" @NUMINT	Number of values in @INTDAT 
(9)
@NUMFLT	Number of values in @FLTDAT (6)
	

@INTDAT[0]	Entity type (3)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Line type:
	1 = Solid
	2 = Dashed
	3 = Center line
	4 = Phantom line
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
@INTDAT[8]	Definition view number (1-n)
	

@FLTDAT[0]	X value of center point (in arc defined view 
coordinates)
@FLTDAT[1]	Y value of center point (in arc defined view 
coordinates)
@FLTDAT[2]	Z value of center point (in arc defined view 
coordinates)
@FLTDAT[3]	Arc radius
@FLTDAT[4]	Start angle (in radians)
@FLTDAT[5]	Delta of angle (in radians)
	

@MSCDAT[0]	Entity ID


CIRCULAR DIMENSION

 XE "CIRDIM" @NUMINT	Number of values in @INTDAT (9)
@NUMFLT	Number of values in @FLTDAT (3)
@NUMSTR	Length of dimension text (Maximum 1024)

	
@INTDAT[0]	Entity type (12)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance  number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Font number (1-6 = old style number, 0 = font # in @TXTATT[0])
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
@INTDAT[8]	Dimension type:
	1 = Radial circular dimension	
	2 = Diametral circular dimension	
	3 = Bent radial circular dimension.	


@FLTDAT[0]	X coordinate of note in view coordinate system
@FLTDAT[1]	Y coordinate of note in view coordinate system
@FLTDAT[2]	Z coordinate of note in view coordinate system
	

@DIMINFO1[]	Refer to System Arrays (Appendix II) for details
@DIMINFO2[]	Refer to System Arrays (Appendix II) for details
@ENTATT[]	Refer to System Arrays (Appendix II) for details
@MSCDAT[]	Refer to System Arrays (Appendix II) for details
@REFARC[]	Refer to System Arrays (Appendix II) for details
@REFPNT[]	Refer to System Arrays (Appendix II) for details
@STRDAT[]	Refer to System Arrays (Appendix II) for details
@TXTATT[]	Refer to System Arrays (Appendix II) for details
@TXTINFO[]	Refer to System Arrays (Appendix II) for details
	                                                 
CONIC

 XE "CONIC" @NUMINT	Number of values in @INTDAT (11)
@NUMFLT	Number of values in @FLTDAT (variable)
 	

@INTDAT[0]	Entity type (4)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Line type:
	1 = Solid
	2 = Dashed
	3 = Center line
	4 = Phantom line
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
@INTDAT[8]	Definition view number (1-n)
@INTDAT[9]	Conic type:
	0 = Point
	1 = Line
	2 = Circular arc
	3 = Elliptical arc
	4 = Parabolic arc
	5 = Hyperbolic arc
@INTDAT[10]	Number of segments (1-2)
	

@FLTDAT[0]	Depth
@FLTDAT[1]	2D rational quadratic coefficients of the first segment
@FLTDAT[2]	w(u)=@FLTDAT[7]*u2+@FLTDAT[8]*u+@FLTDAT[9]
        	x(u)=(@FLTDAT[1]*u2+@FLTDAT[2]*u+@FLTDAT[3])/w(u)
        	y(u)=(@FLTDAT[4]*u2+@FLTDAT[5]*u+@FLTDAT[6])/w(u)
@FLTDAT[9]	
	
If @INTDAT[10] = 2, six more entries to @FLTDAT are made:
	
@FLTDAT[10]	2D rational quadratic coefficients of the second 
segment
@FLTDAT[11] 	x(u) = (@FLTDAT[10]*u2 + @FLTDAT[11]*u + 
@FLTDAT[12])/w(u)
	y(u) = (@FLTDAT[13]*u2 + @FLTDAT[14]*u + 
@FLTDAT[15])/w(u)
@FLTDAT[15]	
@FLTDAT[16]	Start display segment number and u parameter
@FLTDAT[17]	End display segment number and u parameter

Note: display segment number = integer; u parameter = decimal
	

@MSCDAT[0]	Entity ID

GENERIC DIMENSION

 XE "GENDIM" @NUMINT	Number of values in @INTDAT (21)
@NUMFLT	Number of values in @FLTDAT (variable)
@NUMSTR	Number of values in @STRDAT (variable)

	
@INTDAT[0]	Entity type (20)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Old style font number (1-6)
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
@INTDAT[8]	Definition view number (1-n)
@INTDAT[9]	Decimal precision (0-15)
@INTDAT[10]	Use zero representation for tolerance (0 = false, 1 = true)
@INTDAT[11]	Use leading zeros (0 = false, 1 = true)
@INTDAT[12]	Use trailing zeros (0 = false, 1 = true)
@INTDAT[13]	Arrowhead type (0-3)
@INTDAT[14]	Usage is as dimension (1)
@INTDAT[15]	Mirror text (0 = false, 1 = true)
@INTDAT[16]	Text path:
	0 = Right --> Left
	1 = Up --> Down
	2 = Left --> Right
	3 = Down -> Up
@INTDAT[17]	Number of lines (0-9)
@INTDAT[18]	Number of arcs (0-2)
@INTDAT[19]	Number of arrowheads (0-2)
@INTDAT[20]	Form number:
	0-49 = User defined
	50 = Linear dimension
	51 = Radial dimension
	52 = Diametrical dimension
	53 = Angular dimension
	54 = Ordinate dimension
	55 = Point dimension (circle surrounds text)
	56 = Point dimension (hexagon surrounds text)
	57 = Flag note
	58 = Balloon note
	59-63 = Reserved

	
@FLTDAT[0]	Text start X position
@FLTDAT[1]	Text start Y position
@FLTDAT[2]	Text height
@FLTDAT[3]	Aspect ratio
@FLTDAT[4]	Angle string makes with positive X axis
@FLTDAT[5]	X value of center of first arc
@FLTDAT[6]	Y value of center of first arc
@FLTDAT[7]	Radius of first arc
@FLTDAT[8]	Starting angle of first arc (radians)
@FLTDAT[9]	Ending angle of first arc (radians)
@FLTDAT[10]	X value of center of second arc
@FLTDAT[11]	Y value of center of second arc
@FLTDAT[12]	Radius of second arc
@FLTDAT[13]	Starting angle of second arc (radians)
@FLTDAT[14]	Ending angle of second arc (radians)
@FLTDAT[15]	X value of first arrowhead point
@FLTDAT[16]	Y value of first arrowhead point
@FLTDAT[17]	Rotation angle of first arrowhead (radians)
@FLTDAT[18]	X value of second arrowhead point
@FLTDAT[19]	Y value of second arrowhead point
@FLTDAT[20]	Rotation angle of second arrowhead (radians)
@FLTDAT[21]	X value of first endpoint of first line
@FLTDAT[22]	Y value of first endpoint of first line
@FLTDAT[23]	X value of second endpoint of first line
@FLTDAT[24]	Y value of second endpoint of first line
	..
@FLTDAT[53]	X value of first endpoint of ninth line
@FLTDAT[54]	Y value of first endpoint of ninth line
@FLTDAT[55]	X value of second endpoint of ninth line
@FLTDAT[56]	Y value of second endpoint of ninth line
	
Because there are 4 values per line, @NUMFLT equals 21 plus 
(@INTDAT[17] times 4).	
	

@STRDAT[0]	First character in dimension
@STRDAT[1]	Second character in dimension
.	
.	
@STRDAT[n]	Last character in dimension (null)
	

@MSCDAT[0]	Entity ID
@MSCDAT[1]	New style font number (0 - 15)
@MSCDAT[2]	Text slant angle (-31 through 31)
@MSCDAT[3]	Fill text (0 = false, 1 = true)
@MSCDAT[4]	Proportionally spaced text (0 = false, 1 = true)
@MSCDAT[5]	Underlined text (0 = false, 1 = true)
@MSCDAT[6]	Text line spacing factor

LABEL

 XE "LABEL" @NUMINT	Number of values in @INTDAT (8)
@NUMFLT	Number of values in @FLTDAT (3)
@NUMSTR	Length of label text (Maximum 1024)


@INTDAT[0]	Entity type (16)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Font number (1-6 = old style number, 0 = font # in @TXTATT[0])
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)


@FLTDAT[0]	X coordinate of note in view coordinate system
@FLTDAT[1]	Y coordinate of note in view coordinate system
@FLTDAT[2]	Z coordinate of note in view coordinate system


@ENTATT[]	Refer to System Arrays (Appendix II) for 
details
@LDRLN[]	Refer to System Arrays (Appendix II) for 
details
@MSCDAT[]	Refer to System Arrays (Appendix II) for 
details
@STRDAT[]	Refer to System Arrays (Appendix II) for 
details
@TXTATT[]	Refer to System Arrays (Appendix II) for 
details
@TXTINFO[]	Refer to System Arrays (Appendix II) for 
details
@WITLN[]	Refer to System Arrays (Appendix II) for 
details

LEADER

 XE "LEADER" @NUMINT	Number of values in @INTDAT (9)
@NUMFLT	Number of values in @FLTDAT (1)


@INTDAT[0]	Entity type (17)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Font number (1-6 = old style number, 0 = font # in @TXTATT[0])
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
@INTDAT[8]	View-only flag:
	0 = Display in all views
	1 = Display only in view of definition	
	

@FLTDAT[0]	Depth of leader in view coordinate system


@ENTATT[]	Refer to System Arrays (Appendix II) for 
details
@LDRLN[]	Refer to System Arrays (Appendix II) for 
details
@MSCDAT[]	Refer to System Arrays (Appendix II) for 
details

LINE

 XE "LINE" @NUMINT	Number of values in @INTDAT (8)
@NUMFLT	Number of values in @FLTDAT (6)
	

@INTDAT[0]	Entity type (2)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Line type:
	1 = Solid
	2 = Dashed
	3 = Center line
	4 = Phantom line
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
	

@FLTDAT[0]	X value of first endpoint (in world coordinates)
@FLTDAT[1]	Y value of first endpoint (in world coordinates)
@FLTDAT[2]	Z value of first endpoint (in world coordinates)
@FLTDAT[3]	X value of second endpoint (in world coordinates)
@FLTDAT[4]	Y value of second endpoint (in world coordinates)
@FLTDAT[5]	Z value of second endpoint (in world coordinates)
	

@MSCDAT[0]	Entity ID

LINEAR DIMENSION

 XE "LINDIM" @NUMINT	Number of values in @INTDAT (9)
@NUMFLT	Number of values in @FLTDAT (4)
@NUMSTR	Length of  dimension text (Maximum 1024)


@INTDAT[0]	Entity type (11)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Font number (1-6 = old style number, 0 = font # in @TXTATT[0])
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
@INTDAT[8]	Dimension type:
1  =	Horizontal linear dimension
2  =	Vertical linear dimension
3  =	Parallel linear dimension
4  =	Radius dimensioned as horizontal linear distance between center of 
        arc/circle and edge of arc/circle
5  =	Radius dimensioned as vertical linear distance between center of 
        arc/circle and edge of arc/circle
6  =	Radius dimensioned as linear distance parallel to center and edge 
        of arc/circle
7  =	Diameter dimensioned horizontally
8  =	Diameter dimensioned vertically
9  =	Diameter dimensioned in parallel to reference line.
10 = Chamfer angle
11 = Chamfer angle 45 degree style


@FLTDAT[0]	X coordinate of note in view coordinate system
@FLTDAT[1]	Y coordinate of note in view coordinate system
@FLTDAT[2]	Z coordinate of note in view coordinate system
@FLTDAT[3]	Axis angle (in degrees)


@DIMINFO1[]	Refer to System Arrays (Appendix II) for details
@DIMINFO2[]	Refer to System Arrays (Appendix II) for details
@ENTATT[]	Refer to System Arrays (Appendix II) for details
@MSCDAT[]	Refer to System Arrays (Appendix II) for details
@REFLN[]	Refer to System Arrays (Appendix II) for details
@STRDAT[]	Refer to System Arrays (Appendix II) for details
@TXTATT[]	Refer to System Arrays (Appendix II) for details
@TXTINFO[]	Refer to System Arrays (Appendix II) for details
                                                         
NOTE

 XE "NOTE" @NUMINT	Number of values in @INTDAT (8)
@NUMFLT	Number of values in @FLTDAT (3)
@NUMSTR	Length of text string


@INTDAT[0]	Entity type (15)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Font number (1-6 = old style number, 0 = font # in @TXTATT[0])
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)


@FLTDAT[0]	X coordinate of note in view coordinate system
@FLTDAT[1]	Y coordinate of note in view coordinate system
@FLTDAT[2]	Z coordinate of note in view coordinate system


@ENTATT[]	Refer to System Arrays (Appendix II) for details
@MSCDAT[]	Refer to System Arrays (Appendix II) for details
@STRDAT[]	Refer to System Arrays (Appendix II) for details
@TXTATT[]	Refer to System Arrays (Appendix II) for details
@TXTINFO[]	Refer to System Arrays (Appendix II) for details
                                                         
ORDINATE DIMENSION

 XE "ORDDIM" @NUMINT	Number of values in @INTDAT (9)
@NUMFLT	Number of values in @FLTDAT (4)
@NUMSTR	Length of dimension text (Maximum 1024)


@INTDAT[0]	Entity type (21)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Font number (1-6 = old style number, 0 = font # in @TXTATT[0])
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
@INTDAT[8]	Dimension type:
	1 = Horizontal ordinate dimension
	2 = Vertical ordinate dimension
	3 = Parallel ordinate dimension


@FLTDAT[0]	X coordinate of note in view coordinate system
@FLTDAT[1]	Y coordinate of note in view coordinate system
@FLTDAT[2]	Z coordinate of note in view coordinate system
@FLTDAT[3]	Axis angle (in degrees)

@DIMINFO1[]	Refer to System Arrays (Appendix II) for details
@DIMINFO2[]	Refer to System Arrays (Appendix II) for details
@ENTATT[]	Refer to System Arrays (Appendix II) for details
@MSCDAT[]	Refer to System Arrays (Appendix II) for details
@REFPNT[]	Refer to System Arrays (Appendix II) for details
@STRDAT[]	Refer to System Arrays (Appendix II) for details
@TXTATT[]	Refer to System Arrays (Appendix II) for details
@TXTINFO[]	Refer to System Arrays (Appendix II) for details
                                                         
POINT

 XE "POINT" @NUMINT	Number of values in @INTDAT (8)
@NUMFLT	Number of values in @FLTDAT (3)
	

@INTDAT[0]	Entity type (1)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Reserved for future use.
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
	

@FLTDAT[0]	X value in world coordinates
@FLTDAT[1]	Y value in world coordinates
@FLTDAT[2]	Z value in world coordinates
	

@MSCDAT[0]	Entity ID

POLYGON

 XE "POLYGON" @NUMINT	Number of values in @INTDAT (11)
@NUMFLT	Number of values in @FLTDAT (variable)
	

@INTDAT[0]	Entity type (6)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Border line type:
	1 = Solid
	2 = Dashed
	3 = Center line
	4 = Phantom line
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
@INTDAT[8]	Fill type (0 = no fill, 1 = solid fill)
@INTDAT[9]	Fill Color (1-256 = fill color, 0 = no fill)
@INTDAT[10]	Number of vertices (3-8)
	

@FLTDAT[0]	X value of vertex 1 (in world coordinates)
@FLTDAT[1]	Y value of vertex 1 (in world coordinates)
@FLTDAT[2]	Z value of vertex 1 (in world coordinates)
@FLTDAT[3]	X value of vertex 2 (in world coordinates)
@FLTDAT[4]	Y value of vertex 2 (in world coordinates)
@FLTDAT[5]	Z value of vertex 2 (in world coordinates)
.	
.	
@FLTDAT[21]	X value of vertex 8 (in world coordinates)
@FLTDAT[22]	Y value of vertex 8 (in world coordinates)
@FLTDAT[23]	Z value of vertex 8 (in world coordinates)
	
Because there are three values per vertex, @NUMFLT is equal to 
@INTDAT[10] times three.	
	

@MSCDAT[0]	Entity ID


POLYLINE

 XE "POLYLINE" @NUMINT	Number of values in @INTDAT (10)
@NUMFLT	Number of values in @FLTDAT (variable)
	

@INTDAT[0]	Entity type (7)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Border line type:
	1 = Solid
	2 = Dashed
	3 = Center line
	4 = Phantom line
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
@INTDAT[8]	Definition view number (1-n)
@INTDAT[9]	Polyline type:
	0 = Open
	1 = Closed
	2 = Filled
@INTDAT[10]	Display style:
	0 = Centerline
	1 = Round ends at width
	2 = Square ends at width
	3 = Tool path at width
@INTDAT[11] 	Fill style (display styles 1 and 2):
	0 = No fill
	1 = Solid fill
	2-15 = Pattern
@INTDAT[12]	Number of endpoints

	
@FLTDAT[0]	Line width
@FLTDAT[1]	X value of endpoint 1 (in world coordinates)
@FLTDAT[2]	Y value of endpoint 1 (in world coordinates)
@FLTDAT[3]	Z value of endpoint 1 (in world coordinates)
@FLTDAT[4]	X value of endpoint 2 (in world coordinates)
@FLTDAT[5]	Y value of endpoint 2 (in world coordinates)
@FLTDAT[6]	Z value of endpoint 2 (in world coordinates)
	
Since there are three values per endpoint, @NUMFLT is equal to 1 plus 
(@INTDAT[12] times three).	
	
@MSCDAT[0]	Entity ID

SPLINE

 XE "SPLINE" @NUMINT	Number of values in @INTDAT (14)
@NUMFLT	Number of values in @FLTDAT (variable)
	

@INTDAT[0]	Entity type (5)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Line type:
	1 = Solid
	2 = Dashed
	3 = Center line
	4 = Phantom line
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only).
@INTDAT[8]	Dimension flag  (0 = 2D, 1 = 3D)
@INTDAT[9]	Cyclic flag (0 = open, 1 = closed)
@INTDAT[10]	Definition view number (1-n, for 2D spline only)
@INTDAT[11]	Number of segments
@INTDAT[12]	Start display segment
@INTDAT[13]	End display segment
	
If @INTDAT[8] equals 0 (2D spline), eight values are defined per spline 
segment as follows.  Thus, @NUMFLT is equal to (@INTDAT[11]*8) + 1.
 	

@FLTDAT[0]	Depth of spline
@FLTDAT[1]	Coefficients of first segment
@FLTDAT[8] 	
@FLTDAT[9] 	Coefficients of second segment
@FLTDAT[16] 	
	
If @INTDAT[8] equals 1 (3D spline), 12 values are defined per spline 
segment as follows. @NUMFLT is equal to @INTDAT[11] times 12.	
	
@FLTDAT[0] 	Coefficients of first segment
@FLTDAT[11]	
@FLTDAT[12] 	Coefficients of second segment
@FLTDAT[23] 	
	

@MSCDAT[0]	Entity ID
WITNESS

 XE "WITNESS" @NUMINT	Number of values in @INTDAT (9 )
@NUMFLT	Number of values in @FLTDAT (1)


@INTDAT[0]	Entity type (18)
@INTDAT[1]	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Font number (1-6 = old style number, 0 = font # in @TXTATT[0])
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
@INTDAT[8]	View-only flag:
	0 = Display in all views
	1 = Display only in view of definition


@FLTDAT[0]	Depth of leader in view coordinate 
system


@ENTATT[]	Refer to System Arrays (Appendix II) for details
@MSCDAT[]	Refer to System Arrays (Appendix II) for details
@WITLN[]	Refer to System Arrays (Appendix II) for details

XHATCH

 XE "XHATCH" @NUMINT   	Number of values in @INTDAT  (variable)
@NUMFLT   	Number of values in @FLTDAT (variable)

	
@INTDAT[0]	Entity type (19)
@INTDAT[1] 	Group number (1-127 = group number, 0 = none)
@INTDAT[2]	Group instance (1-255 = group instance number, 0 = none)
@INTDAT[3]	Color (0-15)
@INTDAT[4]	Level number (1-255)
@INTDAT[5]	Line type:
	1 = Solid
	2 = Dashed
	3 = Center line
	4 = Phantom line
@INTDAT[6]	Pen (0-7)
@INTDAT[7]	Width (1-15, odd only)
@INTDAT[8]	Definition view number (1-n)
@INTDAT[9]	Hatch pattern value (1-18)
@INTDAT[10]	Number of line styles
@INTDAT[11]	First line style
@INTDAT[12]	Number of lines for first line style
@INTDAT[13]	Second line style
@INTDAT[14]	Number of lines for second line style
	
Since there is a style and a count for each line style, @NUMINT is equal 
to 10 + (@INTDAT[10] times 2).	
	
@FLTDAT[0]	X value of first endpoint of first line
@FLTDAT[1]	Y value of first endpoint of first line
@FLTDAT[2]	X value of second endpoint of first line
@FLTDAT[3]	Y value of second endpoint of first line
@FLTDAT[4]	X value of first endpoint of second line
@FLTDAT[5]	Y value of first endpoint of second line
@FLTDAT[6]	X value of second endpoint of second line
@FLTDAT[7]	Y value of second endpoint of second line

The value of @NUMFLT is the total of the number of lines for each line 
style 
(i.e., @INTDAT[12] + @INTDAT[14] + etc).	
	

@MSCDAT[0]	Entity ID



