TAL Reference Manual

Standard Functions
TAL Reference Manual526371-001
14-37
Example of $PARAM Function
Example of $PARAM Function
In this example, $PARAM checks for the absence of each required parameter and for
the presence of the optional parameter:
PROC var_proc (buffer,length,key) VARIABLE;
INT .buffer, length, !Required parameters
key; !Optional parameter
BEGIN
!Some code here
IF NOT $PARAM (buffer) OR NOT $PARAM (length) THEN RETURN;
!Return 1 or 0 for each
! required parameter
IF $PARAM (key) THEN ... ; !Return 1 if optional
END; ! parameter is present
$POINT Function
The $POINT function returns the fpoint value, in integer form, associated with a FIXED
expression.
fixed-expression
is a FIXED expression.
Usage Considerations
The compiler emits no instructions when evaluating fixed-expression. Therefore, fixed-
expression cannot invoke a function and cannot be an assignment expression.
Example of $POINT Function
This example retains precision automatically when performing fixed-point division.
$POINT returns the
fpoint value of B to $SCALE, which then scales A by that factor:
FIXED(3) result; !Declare variables
FIXED(3) a;
FIXED(3) b;
result := $SCALE (a, $POINT (b)) / b;
!Return fpoint of FIXED expression
! and scale value by that factor
$POINT
(
fixed-expression
)
VST1438.vsd