Skip to content

gmplMethodStatement

Method is a nonterminal, declaration statement that occurs within Class statements and within the refactoring statement Migclass. It is also used within metalanguage class declarations and has some attributes that are only used in that context. A method is a coded procedure that may have arguments associated with it and that may return a value. The role of the declaration here is to specify those arguments, return value type. and any other needed migration/metalanguage information. What the method actually does, the code associated with its implementation, is not of interest here.

The attributes of the Method statement are as follows:

AttributeDescription
IdThis attribute is the identifier of the method. It must be unique within the scope of the class
containing the method. The identifier is not case-sensitive.
TypeThis attribute is a Type attribute as discussed on the Declaration page. It
specifies the return type of the method. Subprograms, methods that return no value, have
a type Void.
StatusThis attribute is the Status attribute as discussed on the Declaration page. It
specifies the various context flags to be associated with the method.
NetNameThis attribute is the identifier of the method to be used when declaring or referring to it
in the target language.
MigNameThis attribute is identical to NetName. If both are used in the declaration the Migname
takes precedence.
MigStatusThis attribute is a MigStatus attribute as discussed on the Declaration page. It
contains generalized migration settings for the component
MigCommentThis deprecated string attribute associates a comment with the method. This comment does not
trigger the gmNI event handlers and can interfere with the MigStatus attribute.
MigPatternThis string attribute associates a surface pattern string with code references to the method. See
the Patterns page for details on the content of pattern strings. It is equivalent to the All
pattern.
CshPatternThis string attribute associates a surface pattern string with code references to the method. See
the Patterns page for details on the content of pattern strings. It is equivalent to the Csh
pattern.
VbnPatternThis string attribute associates a surface pattern string with code references to the method. See
the Patterns page for details on the content of pattern strings. It is equivalent to the Vbn
pattern.
NpramThis integer attribute specifies the number of parameters associated with the surface pattern strings.
RoleThis attribute contains an optional keyword describing the overall role of the operation being
authored via the surface pattern strings: Unknown, Property, Method, Define,
Utility, Command, Constant, Function, Event, Control,
Collection, Resource, Index, or Migclass. The default is None.
PatstatusAn optional keyword describing the overall status of the operation authored via the surface pattern
strings: Ok, Delete, Deprecated, NotImplemented, MustCorrect,
NotIdent, Postfix, or NeedsPren. The default is Ok.
OverrideUserThis is an On/Off flag attribute. The On setting sets the OverrideUser status flag
On. For components that are used to satisfy Implementation requirements, this flag forces the
component to have the attributes as specified in the interface as opposed to as specified in the user code.
OverloadThis is an On/Off flag attribute. The On setting sets the Overload context flag
On. The method needs to be explicitly given the Overload adornment when declared.
OverridecallThis is an On/Off flag attribute. The On setting sets the CastType status flag
On. This means that the method does not require type casts when setting its values.
CanbenullThis is a On/Off flag attribute. The On setting sets the CanbeNull status flag
On. This means that checks of the return value for being empty can be Null as well.
References to them in the intermediate code have to be checked if they are they are Null or Empty.
OpcodeThis attribute is only used with metalanguage declarations. It specifies the actual
opcode.subcode byte pair to be issued by references to the method as opposed to the normal
call operations.
SyntaxThis attribute indicates that the method uses special syntax for specifying its arguments. The
syntax types are Line, Pset, Scale, Print, and Event.

The declarations within the Method statement are as follows:

SubstatementDescription
ArgumentDefines one of the method arguments.

The script errors associated with the Method statement are as follows:

ErrorDescription
1130Method command missing required id attribute.
1131Unable to store METHOD vector: %1d
1132The syntax cannot be found.
1133The subprogram type is undefined.
1134Encountered following when expecting ‘argument’: %1d