ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Reflection functions
  • Retrieving a definition
  • Error handling
  • Supported and unsupported elements
  • Limitations
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Retrieves the element type definition.
Example
PROCEDURE Proc(x)
// Retrieves the definition of x type
MyDefinition is Definition
MyDefinition = GetDefinition(x)
Syntax
<Result> = GetDefinition(<Element>)
<Result>: Definition
Definition variable.
<Element>: Variable or class member
Element for which the definition will be retrieved.
Remarks

Retrieving a definition

GetDefinition retrieves the content type definition (not the variable type definition).
New in version 2025
To retrieve the variable type definition, use GetVariableDefinition.
Example:
Two classes, "DerivedClass" and "BaseClass", derive from each other. If the instances of "DerivedClass" and "BaseClass" are handled by a "dynamic BaseClass" variable, GetDefinition returns the definition of real class of instance.
po is dynamic BaseClass
d is Definition
po = new BaseClass
d = GetDefinition(po)		// Returns the definition of BaseClass
d = GetVariableDefinition(po)	// Returns the definition of BaseClass

po = new DerivedClass
d = GetDefinition(po)		// Returns the definition of DerivedClass
d = GetVariableDefinition(po)	// Returns the definition of BaseClass

Error handling

If the type of the element is not supported, GetDefinition returns a Null definition with a non-fatal error ("Invalid definition").
If the element is not allocated, GetDefinition returns a Null definition with a non-fatal error ("Element not allocated").
Error cases can be processed:
  • by comparing the description to Null.
  • by checking the value of the ErrorOccurred variable.

Supported and unsupported elements

The following types of elements are supported:
  • native variables and members
  • advanced variables and members
  • class variables and members
  • structure variables and members
The following types of elements are not supported:
  • .NET variables and members
  • windows, reports, pages, controls, etc.
  • HFSQL data files, queries, items, etc.

Limitations

  • In a project, you cannot retrieve the definition of an instance coming from:
    • an external component.
    • an internal component.
  • In an external component, you cannot retrieve the definition of an instance coming from the host project.
Component: wd300vm.dll
Minimum version required
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/06/2025

Send a report | Local help