Language and Conventions Overview | Introduction to GPAs
数据范围表示的设定值的全局参数可以假定的。例如,GPA符号&DENS控制曲线的密度,有1,2或3。这些值的数据范围可以直接分配到GPA和窝点,或相应的GPA常数和&NORMAL,和&HEAVY,与&THIN可使用代替。
例如:
&DENS = &HEAVY
等效于语句:
&DENS = 2.
As future enhancements may change the meaning of a value for a GPA symbol, it is strongly recommended that GPA constants be used whenever possible. For example, setting &TOLER = 4 currently indicates a bilateral single line tolerance for subsequent dimensions. However, a future enhancement may associate a
Some numerical ranges accept user defined values instead of fixed integers as above. The range may be plus or minus any valid Unigraphics number, or any real number greater than or equal to zero, or any real number greater than zero.
For example, the grid size (&GSIZE) has a range of any valid Unigraphics number greater than zero. The arrowhead size (&ASIZE) has a range of any valid Unigraphics number greater than zero. It must be greater than zero since a zero length arrowhead would not make sense.
The following abbreviations are used to refer to numerical ranges.
Numerical Range |
Abbreviation |
Greater Than Zero |
GT 0 |
Greater Than or Equal to Zero |
GE 0 |
Any Valid Unigraphics Number |
infinity |
Error checking is performed on GPA symbols during compilation and execution to ensure proper access type, data type and data range. The access type and data type will be checked during compilation and the data range will be checked during execution.
For example, &DENS is of access type RW and data type N. The assignment &DENS='THIN' is an attempt to assign a string value to &DENS instead of a numerical value. This would result in an error during the compilation phase. Attempting to set the value of a GPA symbol with an access type of RO, will also result in an error during compilation. For example, the assignment &USERID='MANAGER' would result in an error since &USERID is a READ ONLY type of GPA.
The data range of a GPA symbol, however, will be checked at run time only. For example, the GPA symbol &FONT has a data range of 1 thru 4. The assignment &FONT = 6 would compile with no errors, but would result in an error at execution time.