Overview | Statement List


调用子程序

Synopsis

CALL/'subprogram name'[,actual argument list]

Description

Transfers control of program execution to a subprogram. Variables and arguments from the main program can be passed to the subroutine as it is being called. Values calculated in the subroutine, can in turn, be passed back when the subroutine returns to the main program.

Parameters

Parameter

Description

'subprogram name'

The name of the subprogram to be executed. The name used must be a string literal in single quotes, string variables are not allowed.

NOTE: When linking, Unigraphics attempts to locate files that are in the same case (lower/upper) in which the 'subprogram' was written. If Unigraphics does not find the file, it converts to lower case and continues the search.

NOTE: The maximum number of externals/subroutine calls in a program is 50.

NOTE: GRIP does not support recursion.

NOTE: GRIP allows a total of 1000 labels per subroutine. The DO loop generates two labels, the CALL command generates a label, and the IFTHEN/ELSE/ELSEIF/ENDIF uses 2 labels plus 1 for every ELSEIF. These labels count against the total you can use.

actual argument list

A list of up to 25 values which may be any combination of numbers, objects, strings, or variables. A variable may be either a simple variable or an array of which all or only a portion may be passed to the the subprogram.

Passing only a portion of an array involves the use of the subrange operator as follows:

CALL/'SUB1',X,Y,A,B(10..25)

An alternative to using the subrange operator in a CALL statement is to pass the entire array and the subrange bounds as two additional arguments. However, whether a single value, an array or a portion of an array is passed in the argument list the corresponding dummy arguments in the subprogram must agree in type, quantity and order.

 


Copyright ©2015 胡君NX二次开发官网(www.UGapi.com) QQ:85585969 All Rights Reserved.