PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview of a class
  • Example of class
  • Creating and declaring a class
  • Creating a class
  • Syntax for declaring the class and its elements
  • Detailed syntax of class declaration
  • Example
  • Declaring the members of a class
  • Syntax
  • Detailed syntax
  • Declaring the array members
  • Serializing the members of a class
  • Databinding
  • Generating the methods for accessing a class member (kept for backward compatibility)
  • Declaring the class constants
  • Syntax
  • Detailed syntax
  • Example
  • Declaring a singleton
  • Creating and declaring the class methods
  • Creating a class method
  • Syntax for declaring a method
  • Detailed syntax
  • Scope identified by the color of the bar
  • Deleting a method
  • Creating and declaring properties
  • Overview
  • Creating a class property
  • Databinding
  • Access rights to a property
  • Members and properties
  • Inheritance
  • Passing properties in parameter to a WLanguage function or procedure
  • Class instances with independent HFSQL context
  • Overview
  • Syntax
  • Use
  • Notes
  • Legend of icons used
  • New features since version 9
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
Overview of a class
A class is made of:
  • data, called members.
  • constants.
  • procedures, called methods. A method is a procedure specifically written to handle the objects found in the class.
  • properties. A property is a class element that can be directly used by its name as a member and for which the operations for value assignment and retrieval trigger the execution of a process.
    AndroidUniversal Windows 10 AppJava The class properties are not available. Universal Windows 10 App The class properties are not available.
    Versions 22 and later
    AndroidJava The class properties are now available.
    New in version 22
    AndroidJava The class properties are now available.
    AndroidJava The class properties are now available.
To use a class, you must declare one or more objects. All the objects of a given class have the same attributes and behavior, but their members contain different data.
By default, the members of a class are public, they can be accessed by a method of the class as well as by a process of the project or by one of its elements (window, control, ...).
Versions 17 and later
AndroidUniversal Windows 10 App This feature is now available for the Android and Windows Phone applications.
iPhone/iPad This feature is now available for the iPhone/iPad applications.
New in version 17
AndroidUniversal Windows 10 App This feature is now available for the Android and Windows Phone applications.
iPhone/iPad This feature is now available for the iPhone/iPad applications.
AndroidUniversal Windows 10 App This feature is now available for the Android and Windows Phone applications.
iPhone/iPad This feature is now available for the iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This feature is available in Universal Windows 10 App mode.
Apple Watch This feature is available in Apple Watch mode.
New in version 21
Universal Windows 10 App This feature is available in Universal Windows 10 App mode.
Apple Watch This feature is available in Apple Watch mode.
Universal Windows 10 App This feature is available in Universal Windows 10 App mode.
Apple Watch This feature is available in Apple Watch mode.
Example of class
The "CFile" class includes the members: m_sShortPath, m_sLongPath, m_sExtension, m_sShortName, m_sLongName.
The "CFile" class includes the following methods:
  • FileDate()
  • FileSelection()
  • FileTime()
  • FileSize()
This class has no property.
The following information is displayed in the "Project explorer" pane:
Project explorer,
To find out the legend of the icons used, see the Notes.
Creating and declaring a class

Creating a class

To create a class:
  1. Display the project explorer if necessary ("Display .. Toolbar .. Project explorer").Display the project explorer if necessary (on the "Home" pane, in the "Environment" group, expand "Panes" and select "Project explorer").
  2. In the project explorer, display the popup menu of the "Classes" folder and select "New class".
  3. In the window that is displayed, enter the name of the class and validate.
  4. The code editor displays the code of new class. The declaration process of the class, the constructor and the destructor are automatically created.

Syntax for declaring the class and its elements

<ClassName> is class [, abstract]
<Scope and Rights>
<Declaration Member 1>
<Declaration Member 2>
<Scope and Rights>
<Declaration Member 3>
<Declaration Member 4>
...
<CONSTANT>
<Declaration of Constants>
END

Detailed syntax of class declaration

<ClassName>
Name identifying the class.
Versions 19 and later
abstract: optional
Used to specify that the class is abstract. An abstract class is a base class that groups behaviors common to several classes.
A class is abstract when it is declared as such or if one of its methods is abstract.
An abstract class cannot be instantiated.
New in version 19
abstract: optional
Used to specify that the class is abstract. An abstract class is a base class that groups behaviors common to several classes.
A class is abstract when it is declared as such or if one of its methods is abstract.
An abstract class cannot be instantiated.
abstract: optional
Used to specify that the class is abstract. An abstract class is a base class that groups behaviors common to several classes.
A class is abstract when it is declared as such or if one of its methods is abstract.
An abstract class cannot be instantiated.
<Scope and Rights>
This parameter has the following format: [GLOBAL][ Public/ Public CONSTANT / Protected / Protected CONSTANT / Private ]
GLOBAL: Optional
Defines a global member. This member will exist outside the objects. It can be used without instantiating an object. If several objects are declared, a global member is common to all objects.
<Access Mode>: Optional
Used to restrict the access to this class member.
  • Public (by default): access allowed from any code of the class or project.
  • Public CONSTANT: The value of the member can be read and modified from a code of the class or from a code of a derived class; it can only be read from another code of the application.
  • Protected: access allowed from a code of the class or from a code of a derived class (and "inherited" class)
  • Protected CONSTANT: The value of the member can be read and modified from a code of the class; it can only be read from a code of a derived class; it cannot be accessed from any other code of the application.
  • Private: access allowed from a code of the class
<Declaration Member>
Syntax for declaring the members of the class (see below). The scope and the access rights of members are the current ones.
<Declaration of Constants>
Syntax for declaring the constants (see below).

Example

SystemClass is Class
        Name is string
END
Declaring the members of a class

Syntax

<Member Name> is <Member Type> [ = <Initial Value>]

Detailed syntax

<Member Name>
Name identifying the member.
<Member Type>
Type of the member chosen among the available types of WLanguage.
<Initial Value>
Initial value of member.
SystemClass is Class
        Name is string
PRIVATE
        ClassSize is int
END

Declaring the array members

To declare an array in a class, use the following syntax:
SystemClass is class
DefaultArray is array of 1 int
END
The array is declared like the simple arrays (see Array type for more details).
When copying instances of classes, all the members of the class are copied into the new instance except for the arrays. Therefore, if the value of an array member is modified, this value is modified in all the instances.
To get independent arrays in all instances of classes, a local array must be declared as follows:
SystemClass is class
DefaultArray is local array of 1 int
END

Versions 18 and later
Note: To get independent arrays in all instances of classes:
  1. Display the description window of project: on the "Project" pane, in the "Project" group, click "Description".
  2. In the "Compilation" tab, check "Arrays: the assignment copies the content".
See Project description, compilation tab for more details.
New in version 18
Note: To get independent arrays in all instances of classes:
  1. Display the description window of project: on the "Project" pane, in the "Project" group, click "Description".
  2. In the "Compilation" tab, check "Arrays: the assignment copies the content".
See Project description, compilation tab for more details.
Note: To get independent arrays in all instances of classes:
  1. Display the description window of project: on the "Project" pane, in the "Project" group, click "Description".
  2. In the "Compilation" tab, check "Arrays: the assignment copies the content".
See Project description, compilation tab for more details.
Versions 19 and later

Serializing the members of a class

By default, all the members of a class are serialized.
You have the ability to precisely manage the serialization of each class member:
  • by specifying the member that will be serialized during the call to Serialize.
    This operation can be performed on all types of serialization (WXML, JSON, binary).
  • by changing the member name during the serialization by Serialize.
    This operation can be performed during a binary serialization only.
This management of serialization is performed by using the following syntax:
  • Serialization (or not) of a member:
    <Member Name> is <Member Type> [ = <Initial Value>]
    [, Serialize = <True/False>]
  • Serialization and change of member name:
    <Member Name> is <Member Type> [ = <Initial Value>]
    [, Serialize = <New Name>]
Example:
Cl is Class
// Serialized member
SerializedMember is int
// Non-serialized member
NonSerializedMember is string, Serialize = False  
// Member renamed during the serialization
RenamedMember is int, Serialize = "NewMemberName"
END
New in version 19

Serializing the members of a class

By default, all the members of a class are serialized.
You have the ability to precisely manage the serialization of each class member:
  • by specifying the member that will be serialized during the call to Serialize.
    This operation can be performed on all types of serialization (WXML, JSON, binary).
  • by changing the member name during the serialization by Serialize.
    This operation can be performed during a binary serialization only.
This management of serialization is performed by using the following syntax:
  • Serialization (or not) of a member:
    <Member Name> is <Member Type> [ = <Initial Value>]
    [, Serialize = <True/False>]
  • Serialization and change of member name:
    <Member Name> is <Member Type> [ = <Initial Value>]
    [, Serialize = <New Name>]
Example:
Cl is Class
// Serialized member
SerializedMember is int
// Non-serialized member
NonSerializedMember is string, Serialize = False  
// Member renamed during the serialization
RenamedMember is int, Serialize = "NewMemberName"
END

Serializing the members of a class

By default, all the members of a class are serialized.
You have the ability to precisely manage the serialization of each class member:
  • by specifying the member that will be serialized during the call to Serialize.
    This operation can be performed on all types of serialization (WXML, JSON, binary).
  • by changing the member name during the serialization by Serialize.
    This operation can be performed during a binary serialization only.
This management of serialization is performed by using the following syntax:
  • Serialization (or not) of a member:
    <Member Name> is <Member Type> [ = <Initial Value>]
    [, Serialize = <True/False>]
  • Serialization and change of member name:
    <Member Name> is <Member Type> [ = <Initial Value>]
    [, Serialize = <New Name>]
Example:
Cl is Class
// Serialized member
SerializedMember is int
// Non-serialized member
NonSerializedMember is string, Serialize = False  
// Member renamed during the serialization
RenamedMember is int, Serialize = "NewMemberName"
END

Databinding

The Databinding is available for the members of the class.

Generating the methods for accessing a class member (kept for backward compatibility)

The code editor is used to generate the methods for accessing a class member. All you have to do is:
  1. Declare your member in the class if not already done.
  2. In the "Code" pane, display the description of the class.
  3. Select the member and select "Generate the access methods" from the popup menu.
    Generating the access methods
  4. Two new methods are automatically generated in the class:
    • Writes_<Member Name>
    • Reads_<Member Name>
These methods can be used to access the member.
Declaring the class constants

Syntax

CONSTANT <Constant Name> = <Constant Value>

CONSTANT
<Constant Name> = <Constant Value>
<Constant Name> = <Constant Value>
END

Detailed syntax

<Constant Name>
Name defined for the constant. A constant is public.
<Constant Value>
Value associated with the constant. This value will not change during the program execution.

Example

CONSTANT K=5
CONSTANT
        K=5
        J=10
END
Versions 22 and later
Declaring a singleton
A Singleton is a declaration of unique class instance.
To declare a unique class instance and to allocate it immediately, use the following syntax:
<Name singleton class> is Class
GLOBAL
<Instance name> is <Name singleton class>
END
Example
CSingleton is Class
GLOBAL
m_Singleton is CSingleton
END
New in version 22
Declaring a singleton
A Singleton is a declaration of unique class instance.
To declare a unique class instance and to allocate it immediately, use the following syntax:
<Name singleton class> is Class
GLOBAL
<Instance name> is <Name singleton class>
END
Example
CSingleton is Class
GLOBAL
m_Singleton is CSingleton
END
Declaring a singleton
A Singleton is a declaration of unique class instance.
To declare a unique class instance and to allocate it immediately, use the following syntax:
<Name singleton class> is Class
GLOBAL
<Instance name> is <Name singleton class>
END
Example
CSingleton is Class
GLOBAL
m_Singleton is CSingleton
END
Creating and declaring the class methods

Creating a class method

To create a class method:
  1. Display the project explorer if necessary ("Display .. Toolbar .. Project explorer").Display the project explorer if necessary: on the "Home" pane, in the "Environment" group, expand "Panes" and select "Project explorer".
  2. In the project explorer, display the available classes: to do so, expand the "Classes" folder.
  3. Select the requested class. Display the popup menu of the class (right mouse click) and select "New method".
  4. In the window that is opened:
    • Type the name of method.
    • Versions 21 and later
      Specify whether the comment of the method prototype will be automatically generated ("Generate a header comment" option).
      See Automatic documentation of procedures and methods for more details.
      New in version 21
      Specify whether the comment of the method prototype will be automatically generated ("Generate a header comment" option).
      See Automatic documentation of procedures and methods for more details.
      Specify whether the comment of the method prototype will be automatically generated ("Generate a header comment" option).
      See Automatic documentation of procedures and methods for more details.
    • Specify whether the method is public, protected or private. See the "Access" section of Detailed syntax for more details.
    • Specify whether the method is abstract. See the "Abstract" section of Detailed syntax for more details.
    • Specify whether the method is global. See the "Global" section of Detailed syntax for more details.
    • Validate.
  5. The code editor displays the code of new method.

Syntax for declaring a method

PROCEDURE [<Access>] [Global] [VIRTUAL] [ABSTRACT]
<Method Name> ([<Parameter1>, ...[<ParameterN>]]) [<Extension Attributes>]

Detailed syntax

<Access>: Optional
Used to restrict the access to this method. 3 levels are available:
  • Private: the method can only be called from a code of the class
  • Protected: the method can only be called from a code of the class or from a code of a derived class
  • Public (by default): the method can be called from any code of the class or project.
Global: Optional
Defines a global method. This method will not operate on a specific object: no class object is required to call this method. This class can also be used to handle the global members.
Virtual: Optional
Defines a virtual method. An overridden method is virtual by default.
Versions 19 and later
Abstract: Optional
Defines an abstract method. An abstract method is a method that must absolutely be redefined in the derived classes. A method is not abstract by default.
New in version 19
Abstract: Optional
Defines an abstract method. An abstract method is a method that must absolutely be redefined in the derived classes. A method is not abstract by default.
Abstract: Optional
Defines an abstract method. An abstract method is a method that must absolutely be redefined in the derived classes. A method is not abstract by default.
<Method Name>
Name identifying the method.
<Parameter 1> ... <Parameter N>
Optional parameters to pass to the method.
Versions 23 and later
<Extension Attribute>
Extension attributes used to define the options for managing the code editor. The available extension attributes are:
  • <zombie [comment = "text"]>: Used to define an obsolete method (also called zombie method). The optional comment keyword is used to specify the text that will be displayed in the compilation error associated with the obsolete method. See Zombie procedures for more details.
  • <without step by step>: Used to specify that this method will be ignored by the debugger when debugging in "Step by step" mode.
New in version 23
<Extension Attribute>
Extension attributes used to define the options for managing the code editor. The available extension attributes are:
  • <zombie [comment = "text"]>: Used to define an obsolete method (also called zombie method). The optional comment keyword is used to specify the text that will be displayed in the compilation error associated with the obsolete method. See Zombie procedures for more details.
  • <without step by step>: Used to specify that this method will be ignored by the debugger when debugging in "Step by step" mode.
<Extension Attribute>
Extension attributes used to define the options for managing the code editor. The available extension attributes are:
  • <zombie [comment = "text"]>: Used to define an obsolete method (also called zombie method). The optional comment keyword is used to specify the text that will be displayed in the compilation error associated with the obsolete method. See Zombie procedures for more details.
  • <without step by step>: Used to specify that this method will be ignored by the debugger when debugging in "Step by step" mode.
GLOBAL Procedure ViewObject(obj)
// The private member ClassSize is accessible from the class code
Info("Name: " + Obj:Name + "Size: " + Obj:ClassSize)
GLOBAL FUNCTION Attempt(a1,b1)
RESULT a1 + b1
Versions 16 and later

Scope identified by the color of the bar

A method of a class can be public, private or protected.
The start color of event bar changes according to the scope of method:
  • red beginning of bar: private method.
  • beginning of orange bar: protected method.
  • standard beginning of bar: public method.
Color of method bars
New in version 16

Scope identified by the color of the bar

A method of a class can be public, private or protected.
The start color of event bar changes according to the scope of method:
  • red beginning of bar: private method.
  • beginning of orange bar: protected method.
  • standard beginning of bar: public method.
Color of method bars

Scope identified by the color of the bar

A method of a class can be public, private or protected.
The start color of event bar changes according to the scope of method:
  • red beginning of bar: private method.
  • beginning of orange bar: protected method.
  • standard beginning of bar: public method.
Color of method bars

Deleting a method

A method can be deleted:
  • from the "Project explorer" pane ("Delete" from the popup menu)
  • Versions 16 and later
    from the code editor, via the popup menu of the method bar ("Delete").
    New in version 16
    from the code editor, via the popup menu of the method bar ("Delete").
    from the code editor, via the popup menu of the method bar ("Delete").
Creating and declaring properties

Overview

A property is a code element that includes two processes:
  • a process for retrieving the value,
  • a process for assigning the value.
A property can be used like a variable or like a member (direct retrieval of the value, assignment via the '=' symbol, ...). At run time:
  • Any operation that requires to read the property runs the process for retrieving the value. This process must return a value.
  • Any operation that requires to read the property runs the process for assigning the value that must process a parameter.
AndroidUniversal Windows 10 AppJava The class properties are not available.
Universal Windows 10 App The class properties are not available.
Versions 22 and later
AndroidJava The class properties are now available.
New in version 22
AndroidJava The class properties are now available.
AndroidJava The class properties are now available.

Creating a class property

To create a class property:
  1. Display the project explorer if necessary ("Display .. Toolbar .. Project explorer").Display the project explorer if necessary (on the "Home" pane, in the "Environment" group, expand "Panes" and select "Project explorer").
  2. In the project explorer, display the available classes (expand the "Classes" folder).
  3. Select the requested class. Display the popup menu of the class and select "New property".
  4. In the window that is opened, enter the name of the property and validate.
  5. The code editor displays the processes linked to the property:
    • Process for retrieving the property. This process contains:
      • the "RESULT" keyword that is used to get the value of the property.
      • the "RETURN =" keyword to return the value of the property.
    • Process for assigning the property. This process is used to give a value to the property. This value is passed in parameter. This process must return no result.
Note: A new property can also be created from the popup menu of a member. In this case, the procedures automatically handle the specified member.

Databinding

The Databinding is available for the properties of classes and call members.

Access rights to a property

The property cannot be read if the retrieval process is empty. A compilation error will be displayed in the editor and an error will occur at run time.
The property cannot be written if the assignment process is empty. A compilation error will be displayed in the editor and an error will occur at run time.
The retrieval and assignment processes can be public, private or protected. The access rights of the property correspond to the less restrictive rights of the two processes. See Access rights to a property for more details.
The properties can be global. A property is global to the class when the retrieval and assignment processes are global. If one of the processes is global, all the processes must be global otherwise a compilation error is displayed.

Members and properties

A property and an existing member can have the same name. In this case, the priority orders are as follows:
  • in the processes of the property, the member has priority over the property.
  • in the rest of the code, the property has priority over the member.
Therefore, a member can be replaced by a property without modifying the code that uses the member.
The processes of a property cannot recursively use the property. If no member is named like the property, the use of the property in one of its processes will trigger a compilation error.

Inheritance

The properties of base classes are inherited in the derived classes.
A property can be overloaded in a derived class. The processes of a property are always considered as being virtual: the use of the VIRTUAL keyword is ignored.
The multiple inheritance is supported by the properties. The following syntaxes can be used to call the properties of the base classes:
  • Ancestor.Property if the derived class has a single base class
  • BaseClass.Property otherwise.

Passing properties in parameter to a WLanguage function or procedure

If the parameter is passed by address (default case) and untyped:
  • the property is passed in parameter.
  • no process associated with the property is run during the call.
  • the reading of the formal parameter runs the retrieval code of value.
  • the writing of the formal parameter runs the assignment code of value.
If the parameter is by passed value (LOCAL) and untyped:
  • the property value is passed in parameter.
  • the retrieval code of value is run during the call.
  • the reading of the formal parameter accesses the value passed during the call and it does not run the retrieval code of value.
  • the writing of the formal parameter modifies the value passed during the call and it does not run the assignment code of value.
If the parameter is passed by address (default case) and typed:
  • the property is passed in parameter.
  • the type of the property must be correct. Otherwise, a WLanguage error occurs.
  • no process associated with the property is run during the call.
  • the reading of the formal parameter runs the retrieval code of value.
  • the writing of the formal parameter runs the assignment code of value.
If the parameter is by passed value (LOCAL) and with specific type:
  • the property value is passed in parameter.
  • the retrieval code of value is run during the call.
  • if necessary, the value of the property is converted into the type of the parameter.
  • the reading of the formal parameter accesses the value passed during the call and it does not run the retrieval code of value.
  • the writing of the formal parameter modifies the value passed during the call and it does not run the assignment code of value.
Versions 15 and later
Class instances with independent HFSQL context

Overview

A copy of the HFSQL context can be associated with a class instance. All the accesses to HFSQL performed from the methods and properties of the class (calls to functions or access to the records) operate on the copy of the context of the class instance.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
AndroidUniversal Windows 10 AppJava This feature is not available.

Syntax

The following syntax must be used:
// Declare the class
IndependentHyperFileSQLClass is class, independent HyperFileSQL context

END
or
// Declare the class
IndependentHyperFileSQLClass is class
<independent HyperFileSQL context>

END
// Declare the class
IndependentHFSQLClass is Class, independent <light/full> HFSQL context
END
or
// Declare the class
IndependentHFSQLClass is Class
<independent light/full HFSQL context>

END
For example:
IndependentHFSQLClass is Class, independent light HFSQL context
Versions 20 and later
Light/Full parameter:
  • The "light" keyword triggers the immediate copy of part of HFSQL context.
    Only the directories containing the data files in HFSQL Classic mode and/or the connections in HFSQL Client/Server mode are stored.
  • The "full" keyword triggers the immediate copy of HFSQL context.
    Recommended if the thread must take into account the current positions in the files and queries of caller context.
New in version 20
Light/Full parameter:
  • The "light" keyword triggers the immediate copy of part of HFSQL context.
    Only the directories containing the data files in HFSQL Classic mode and/or the connections in HFSQL Client/Server mode are stored.
  • The "full" keyword triggers the immediate copy of HFSQL context.
    Recommended if the thread must take into account the current positions in the files and queries of caller context.
Light/Full parameter:
  • The "light" keyword triggers the immediate copy of part of HFSQL context.
    Only the directories containing the data files in HFSQL Classic mode and/or the connections in HFSQL Client/Server mode are stored.
  • The "full" keyword triggers the immediate copy of HFSQL context.
    Recommended if the thread must take into account the current positions in the files and queries of caller context.

Use

The HFSQL context of instance is created by copying the current context during the constructor execution.
The = and <= operators between two instances with independent HFSQL context copy the content of HFSQL context.
We do not advise you to use class instances with independent HFSQL context to simulate an alias on a single HFSQL file or on a specific record of a HFSQL file. Indeed, copying the HFSQL context affects all the context elements (files, views, queries, connections, ...) and it can take quite a long time.
A class instance with independent HFSQL context can only be used in the thread that run the constructor. To handle a class instance with independent HFSQL context in several threads, you must:
  • allocate a new instance of the class
  • perform a copy of the source instance with the = or <= operator.
New in version 15
Class instances with independent HFSQL context

Overview

A copy of the HFSQL context can be associated with a class instance. All the accesses to HFSQL performed from the methods and properties of the class (calls to functions or access to the records) operate on the copy of the context of the class instance.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
AndroidUniversal Windows 10 AppJava This feature is not available.

Syntax

The following syntax must be used:
// Declare the class
IndependentHyperFileSQLClass is class, independent HyperFileSQL context

END
or
// Declare the class
IndependentHyperFileSQLClass is class
<independent HyperFileSQL context>

END
// Declare the class
IndependentHFSQLClass is Class, independent <light/full> HFSQL context
END
or
// Declare the class
IndependentHFSQLClass is Class
<independent light/full HFSQL context>

END
For example:
IndependentHFSQLClass is Class, independent light HFSQL context
Versions 20 and later
Light/Full parameter:
  • The "light" keyword triggers the immediate copy of part of HFSQL context.
    Only the directories containing the data files in HFSQL Classic mode and/or the connections in HFSQL Client/Server mode are stored.
  • The "full" keyword triggers the immediate copy of HFSQL context.
    Recommended if the thread must take into account the current positions in the files and queries of caller context.
New in version 20
Light/Full parameter:
  • The "light" keyword triggers the immediate copy of part of HFSQL context.
    Only the directories containing the data files in HFSQL Classic mode and/or the connections in HFSQL Client/Server mode are stored.
  • The "full" keyword triggers the immediate copy of HFSQL context.
    Recommended if the thread must take into account the current positions in the files and queries of caller context.
Light/Full parameter:
  • The "light" keyword triggers the immediate copy of part of HFSQL context.
    Only the directories containing the data files in HFSQL Classic mode and/or the connections in HFSQL Client/Server mode are stored.
  • The "full" keyword triggers the immediate copy of HFSQL context.
    Recommended if the thread must take into account the current positions in the files and queries of caller context.

Use

The HFSQL context of instance is created by copying the current context during the constructor execution.
The = and <= operators between two instances with independent HFSQL context copy the content of HFSQL context.
We do not advise you to use class instances with independent HFSQL context to simulate an alias on a single HFSQL file or on a specific record of a HFSQL file. Indeed, copying the HFSQL context affects all the context elements (files, views, queries, connections, ...) and it can take quite a long time.
A class instance with independent HFSQL context can only be used in the thread that run the constructor. To handle a class instance with independent HFSQL context in several threads, you must:
  • allocate a new instance of the class
  • perform a copy of the source instance with the = or <= operator.
Class instances with independent HFSQL context

Overview

A copy of the HFSQL context can be associated with a class instance. All the accesses to HFSQL performed from the methods and properties of the class (calls to functions or access to the records) operate on the copy of the context of the class instance.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
AndroidUniversal Windows 10 AppJava This feature is not available.

Syntax

The following syntax must be used:
// Declare the class
IndependentHyperFileSQLClass is class, independent HyperFileSQL context

END
or
// Declare the class
IndependentHyperFileSQLClass is class
<independent HyperFileSQL context>

END
// Declare the class
IndependentHFSQLClass is Class, independent <light/full> HFSQL context
END
or
// Declare the class
IndependentHFSQLClass is Class
<independent light/full HFSQL context>

END
For example:
IndependentHFSQLClass is Class, independent light HFSQL context
Versions 20 and later
Light/Full parameter:
  • The "light" keyword triggers the immediate copy of part of HFSQL context.
    Only the directories containing the data files in HFSQL Classic mode and/or the connections in HFSQL Client/Server mode are stored.
  • The "full" keyword triggers the immediate copy of HFSQL context.
    Recommended if the thread must take into account the current positions in the files and queries of caller context.
New in version 20
Light/Full parameter:
  • The "light" keyword triggers the immediate copy of part of HFSQL context.
    Only the directories containing the data files in HFSQL Classic mode and/or the connections in HFSQL Client/Server mode are stored.
  • The "full" keyword triggers the immediate copy of HFSQL context.
    Recommended if the thread must take into account the current positions in the files and queries of caller context.
Light/Full parameter:
  • The "light" keyword triggers the immediate copy of part of HFSQL context.
    Only the directories containing the data files in HFSQL Classic mode and/or the connections in HFSQL Client/Server mode are stored.
  • The "full" keyword triggers the immediate copy of HFSQL context.
    Recommended if the thread must take into account the current positions in the files and queries of caller context.

Use

The HFSQL context of instance is created by copying the current context during the constructor execution.
The = and <= operators between two instances with independent HFSQL context copy the content of HFSQL context.
We do not advise you to use class instances with independent HFSQL context to simulate an alias on a single HFSQL file or on a specific record of a HFSQL file. Indeed, copying the HFSQL context affects all the context elements (files, views, queries, connections, ...) and it can take quite a long time.
A class instance with independent HFSQL context can only be used in the thread that run the constructor. To handle a class instance with independent HFSQL context in several threads, you must:
  • allocate a new instance of the class
  • perform a copy of the source instance with the = or <= operator.
Notes

Legend of icons used

The different icons used are as follows:
Public procedure
Public procedure
Public member
Public member
Protected procedure
Protected procedure
Protected member
Protected member
Private procedure
Private procedure
Private member
Private member
Public virtual method
Public virtual method
Constant public method
Constant public method
Protected virtual method
Protected virtual method
Constant protected member
Constant protected member
Private virtual method
Private virtual method
Constant private member
Constant private member
Public global method
Public global method
Global public member
Global public member
Protected global method
Protected global method
Global protected member
Global protected member
Global private method
Global private method
Global private member
Global private member
Constant
Constant

New features since version 9

A class containing a character member does not have the same behavior as in the earlier versions. Indeed, the characters were coded on 1 byte in the earlier versions and on 2 bytes since version 9.
We recommend that you use the "1-byte integer" type.
Related Examples:
WD Simple OOP Training (WINDEV): WD Simple OOP
[ + ] The "WD Simple OOP" example is an educational example about the OOP with WINDEV. This example presents the operating mode of:
- classes,
- inheritances,
- virtual procedures,
- UML diagrams,
- ...
Minimum required version
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment