TatRoutineInfo Class
TatRoutineInfo holds information about the routine declared in script. You can retrieve parameters, local variables, visibility, and more.
Syntax
Unit: atScript
TatRoutineInfo = class(TCollectionItem);
Methods
| Name | Description |
|---|---|
| DeclareVariable | Do not call DeclareVariable directly. It's used by internal parsers/compilers. |
| Internal | Used by scripter engine only. |
| IsByRefArg | Returns True if the n-th input parameter of the routine is declared as passed by reference. |
| LocalVarCount | Returns the number of local variables declared in the routine, excluding input parameters. |
| PrepareExternalClass | Do not use this method directly. Used for internal purposes only. |
| ScriptInfo | Returns a reference to the TatScriptInfo object which owns this routine info. |
| VariableByName | Returns a TatVariableInfo object related to the variable (or parameter) specified by the name AName. If the variable or parameter doesn't exist, VariableByName returns nil. |
Properties
| Name | Description |
|---|---|
| ArgCount | ArgCount returns the number of input parameters declared in the routine. Note that it doesn't take local variables into account, just input parameters. |
| ByRefArgMask | A bit mask indicating which input parameters of the routine are declared as passed by reference. |
| CallingConvention | Contains information about the calling convention of the declared routine. Used only in dll function calls. |
| DeclarationInstruction | Contains the Prepare p-code instruction that is the entry point of the routine. |
| ExternalDll | Contains the name of the dll declared in the routine prototype. This is only used when the declared routine is a prototype for a dll function call. |
| ExternalName | Contains the real name of the function to be called in the dll. This is only used when the declared routine is a prototype for a dll function call. |
| IsFunction | Returns true if the routine returns a result value. In other words, IsFunction is true when the routine is a function, false if the routine is a procedure/sub. |
| Name | Contains the name of the declared routine. |
| Prototype | References the forward-declared prototype of this routine, if one exists. |
| ResultClassName | Retrieves the name of the declared result class. If the variable type is not a class type, but a scalar type (string, integer, etc.), ResultClassName value will be an empty string. |
| ResultIndex | Contains the index of the variable in the Variables collection that holds the function result. |
| ResultTypeDecl | Contains the textual identifier of the result type of the declared function routine. |
| Variables | Holds a list of TatVariableInfo objects with information about all the parameters and local variables declared in the routine. |
| Visibility | Indicates the visibility of the routine (private or public). |