PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

  • Comparing the instance of a class
  • Finding out the type of an advanced variable
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Class (Property)
In french: Classe
..Class is used to find out the real type of the class instance handled by a variable (object, variant or dynamic object).
On the advanced types (gglxxx, rssxxx or xlsxxx variables), ..Class is used to find out the type of the variable.
Versions 18 and later
Universal Windows 10 App This property is now available in Windows Store Apps mode.
New in version 18
Universal Windows 10 App This property is now available in Windows Store Apps mode.
Universal Windows 10 App This property is now available in Windows Store Apps mode.
Versions 21 and later
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
Versions 22 and later
Java This property is now available for the Java applications.
New in version 22
Java This property is now available for the Java applications.
Java This property is now available for the Java applications.
Example
// Declare the base class named CBase
CBase is Class
END
 
// Declare the sub-class named CSub
CSub is Class
inherits from CBase
END
 
// allocate a dynamic object of BaseC type
po is object dynamic = new CBase
// the real type of the dynamic object is CBase:
// the trace displays the "CBase" string
Trace(po..Class)
 
// allocate a dynamic object of CSub type
po is object dynamic = new CSub
// the real type of the dynamic object is CSub:
// the trace displays the " CSub " string
Trace(po..Class)
...
// Retrieve the array of documents
arrDocs is array of gglDocument = GglListDocument(Cnt)
// Browse the documents
Doc is gglDocument
FOR EACH Doc OF arrDocs
Trace(Doc..Title)
END
...
// Check the type of variable used
IF arrDocs..Class = gglDocument THEN...
Syntax

Finding out the type of the class instance Hide the details

<Result> = <>..Class
<Result>: Character string
  • Name of the class,
  • Empty string ("") if the dynamic object is not allocated.
<>: Character string (with or without quotes)
Name of variable (object, dynamic object or variant) to use.
Remarks

Comparing the instance of a class

The instance of a class can be directly compared to the name of the class (without using quotes).
For example:
IF po..Class = Class1 THEN ...
Another example:
SWITCH po..Class
CASE Class1:  ...
CASE Class2: ...
END

Finding out the type of an advanced variable

..Class used on an advanced variable is used to find out the type of the variable. The name of the type is returned in the language of the runtime framework (in French for a French version, in English for an international version).
In order for a piece of code to be compatible between the French version and the international version, we advise you to directly compare the result of ..Class with the requested type (without quotes). For example:
IF v..Class = Border THEN
...
END
SWITCH v..Class
 CASE Border:
  ...
 CASE xlsRow:
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment