OverrideFunction Meta-Tag
See Also: Class Meta-Data Tags
Purpose
Used to specify that the information in this tag set should be applied to the function name for this class, where the function is an inherited function, not one defined in the current class.
Syntax
{ OverrideFunction={FunctionName} {ClassMemberMetaDataTagName}=MyValue }
where:
- {FunctionName} is the name of the function for which to override the value of {ClassMemberMetaDataTagName}.
- {ClassMemberMetaDataTagName} is the name of the class member meta-data tag to override.
Note: OverrideFunction must be the first name in the tag set, and all other name/value pairs in the tag set will be applied to FunctionName.
Use
This is used to change values of the class member meta-data tag Visibility for a function in a subclass.
Sometimes, the value of a function meta-data tag is different in a subclass of the class where the function was originally declared. To indicate this, use the OverrideFunction class meta-data tag.
To declare the meta-data tag value of a function that is declared in the current class, use the appropriate class member meta-data tag.
OverrideFunction must be used to override the value of any class member meta-data tag for functions in the current subclass. To overwrite the value of properties, procedures, or procedure sets, use OverrideProperty, OverrideProcedure, and OverrideProcedureSet, respectively. Using the wrong override type will result in an error and/or unexpected behavior.
Example
You can override the visibility of an inherited function from a superclass. Setting the Visibility meta-data tag of a function to Private can "hide" the function from all Studio design time access, including CodeSense for the class in which it is overridden.
For example, the following code overrides the visibility of the inherited function IsXYZ from public (the default) in the superclass cFoo, where it is defined, to private in the subclass cFooSub.
Class cFoo is a cObject
Function IsXYZ returns Integer
// function code
End_Function
End_Class
{ OverrideFunction=IsXYZ Visibility=Private }
Class cFooSub is a cFoo
End_Class
Of Special Note
The class member meta-data tag values that are set by OverrideFunction may be inherited. See the documentation for the class member meta-data tag you are overriding to see if it is inherited.