PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Declaring the combinations
  • Enabling or disabling the options of a combination
  • Reading the combination options
  • Passing a combination in parameter to a procedure
  • Assisted input
  • Extension of combination
  • Preset combinations
  • Mutual exclusions
  • Associated properties
  • Available WLanguage functions
  • Limits
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
A combination is a set of options. A combination variable or a combination parameter can be assigned with none, one or more combination options.
Versions 21 and later
Universal Windows 10 App The Combination type is now available for the applications in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App The Combination type is now available for the applications in Universal Windows 10 App mode.
Universal Windows 10 App The Combination type is now available for the applications in Universal Windows 10 App mode.
Versions 23 and later
Java This Combination type is now available for the Java applications.
New in version 23
Java This Combination type is now available for the Java applications.
Java This Combination type is now available for the Java applications.
Example
// Declaration code
// Declare a combination
CombinationType is Combination
CreateFile
ReadFile
WriteFile
DeleteFile
END
// Declare a Combination variable
FileAction is CombinationType
// Assign the variable
FileAction = ReadFile + WriteFile
// FileAction = 0 // Disables all the options
Syntax

Declaring a combination Hide the details

<Combination name> is Combination
   <Combination options>
END
<Combination name>:
Name of combination to declare
<Combination options>:
Different options that can be taken by the combination.
<END>:
End of declaration.

Declaring a Combination variable Hide the details

<Variable name> is <Combination name>
<Variable name>:
Name of Combination variable to declare.
<Combination name>:
Name of combination that was declared beforehand.
Remarks

Declaring the combinations

A combination must be declared in:
  • The initialization code of project in order to be used in all the processes of the project (code of project, code of windows, code of controls, procedures, etc.).
  • The declaration code of global variables of a window in order to be used in all the processes of the window (code of window, code of controls found in the window, local procedures, etc.).
  • The opening code of a report in order to be used in all the processes of the report (code of the report, code of controls found in the report, local procedures, etc.).
  • The declaration code of a class in order to be used in the class.
    • To access this combination from a method of the class, use the syntax "::<Combination name>".
    • To access this combination from a code external to the class, use the syntax "<Class name>::<Combination name>".
  • The declaration code of sets of procedures in order to be used in all the procedures of the set.
Note: A combination is always global:
  • to a project,
  • with a window,
  • to a report,
  • to a class.

Enabling or disabling the options of a combination

Several syntaxes can be used to enable or disable the options of a combination. Some examples:
  • Declaring the combination used for the examples:
    CombinationType is Combination
    CreateFile
    ReadFile
    WriteFile
    DeleteFile
    END

    // Declare a Combination variable
    FileAction is CombinationType
  • Disabling all the options:
    Syntax:
    <Combination Variable> = 0

    Example:
    FileAction = 0
  • Enabling one or more options:
    Syntax:
    <Combination Variable> = Option 1
    <Combination Variable>[Option 1] = True

    <Combination Variable> = Option 1 + Option 2
    <Combination Variable>[Option 1 + Option 2] = True

    Examples:
    FileAction = ReadFile  // Enables an option
    FileAction = ReadFile + WriteFile // Enables 2 options

    FileAction[ReadFile] = True  // Enables an option
    FileAction[ReadFile + WriteFile] = True // Enables 2 options
  • Disabling one or more options:
    Syntax:
    <Combination Variable>[Option 1] = False

    <Combination Variable>[Option 1 + Option 2] = False

    Examples:
    FileAction[ReadFile] = False  // Disables an option
    FileAction[ReadFile + WriteFile] = False // Disables 2 options

Reading the combination options

Several syntaxes can be used to find out the combination options. Some examples:
  • Declaring the combination
    CombinationType is Combination
    CreateFile
    ReadFile
    WriteFile
    DeleteFile
    END

    // Declare a Combination variable
    FileAction is CombinationType
  • Check whether all the options are disabled:
    Syntax:
    IF <Combination Variable> = 0

    Examples:
    IF FileAction = 0 THEN...
  • Check whether an option is enabled:
    Syntax:
    IF <Combination Variable> = Option 1 ...
    IF <Combination Variable>[Option 1] = True...

    Examples:
    IF FileAction = ReadFile THEN ...
    IF FileAction[ReadFile] = True THEN...
  • Check whether several options are enabled:
    Syntax:
    IF <Combination Variable> = Option 1 + Option 2 THEN ...
    IF <Combination variable>[Option 1 + Option 2] = True ...

    Examples:
    IF FileAction = ReadFile + WriteFile THEN ...
    IF FileAction[ReadFile + WriteFile] = True THEN...
  • Check whether at least one option is enabled:
    Syntax:
    IF <Combination Variable>[Option 1] OR <Combination Variable>[Option 2] THEN...

    Examples:
    IF FileAction[ReadFile] OR FileAction[WriteFile] THEN...

Passing a combination in parameter to a procedure

A Combination variable can be passed in parameter to a procedure. To do so, use the following syntax:
<Procedure name>(<Name of combination variable>)
For example:
// Procedure with a Combination parameter
PROCEDURE FileType(p is CombinationType)

// Calls with a Combination parameter
FileType(ReadFile + WriteFile)
FileType(FileAction)

Assisted input

The assisted input for a Combination parameter proposes the different combination options.

Extension of combination

A combination can extend the values of one or more other combinations by taking the options of this ones and by adding new options.
The following syntax is used:
<Combination name> is Combination
   [Base Combination]
   <Combination additional options>
END
where:
  • <Combination name>: Name of combination that was declared beforehand.
  • Base Combination: Name of base combination to use.
  • <Combination additional options>: Additional options that will be taken into account in the combination.
Example:
CombinationType is Combination
CreateFile
ReadFile
WriteFile
DeleteFile
END


AdvancedCombinationType is Combination
[CombinationType]
OtherAttributes
END

Preset combinations

Several options can be combined to force a preset combination. The combined options must belong to the combination (or to base combinations)
The following syntax is used:
<Combination name> is Combination
<Option 1 of combination>
<Option 2 of combination>
<Option 3 of combination> = <Option 1 of combination> + <Option 2 of combination>
END
Example:
CombinationType is Combination
CreateFile
ReadFile
WriteFile
DeleteFile
Read_Write_File = ReadFile + WriteFile
END

Mutual exclusions

You have the ability to describe mutual exclusions between the combination options.
For example, a combination contains three options: Option1, Option2 and Option3. Option2 and Option3 are exclusive:
  • Option1 and Option2 can be active.
  • Option1 and Option3 can be active.
  • Option2 and Option3 cannot be enabled.
  • Option1, Option2 and Option3 cannot be active.
The following syntax must be used:
<Combination name> is Combination
<Option 1 of combination>
<Option 2 of combination>
<Option 3 of combination>
// Exclusions
<Option 2 of combination> - <Option 3 of combination>
END
Note: By combining the extensions and the exclusions, you have the ability to get for the same options:
  • a parameter of a function that imposes an exclusion,
  • a parameter of a function that imposes no exclusion or that imposes a different exclusion.

Associated properties

The following properties are associated with the Combination variables:
NameUsed to find out the name of a Combination variable.
ValueUsed to find out the associated value of a Combination variable.
Versions 19 and later

Available WLanguage functions

A combination can be stored in a HFSQL item or in another file format. Depending on your requirements, you can store the combination name (..Name) or value (..Value).
The following WLanguage functions allow you to get the characteristics of a stored combination:
Versions 19 and later
CombinationCheckName
New in version 19
CombinationCheckName
CombinationCheckName
Checks whether a combination of one of more options known by their names is valid.
Versions 19 and later
CombinationFromName
New in version 19
CombinationFromName
CombinationFromName
Returns a combination of one or more options known by their names.
Versions 19 and later
CombinationFromValue
New in version 19
CombinationFromValue
CombinationFromValue
Returns a combination of one or more options known by their associated values.
New in version 19

Available WLanguage functions

A combination can be stored in a HFSQL item or in another file format. Depending on your requirements, you can store the combination name (..Name) or value (..Value).
The following WLanguage functions allow you to get the characteristics of a stored combination:
Versions 19 and later
CombinationCheckName
New in version 19
CombinationCheckName
CombinationCheckName
Checks whether a combination of one of more options known by their names is valid.
Versions 19 and later
CombinationFromName
New in version 19
CombinationFromName
CombinationFromName
Returns a combination of one or more options known by their names.
Versions 19 and later
CombinationFromValue
New in version 19
CombinationFromValue
CombinationFromValue
Returns a combination of one or more options known by their associated values.

Available WLanguage functions

A combination can be stored in a HFSQL item or in another file format. Depending on your requirements, you can store the combination name (..Name) or value (..Value).
The following WLanguage functions allow you to get the characteristics of a stored combination:
Versions 19 and later
CombinationCheckName
New in version 19
CombinationCheckName
CombinationCheckName
Checks whether a combination of one of more options known by their names is valid.
Versions 19 and later
CombinationFromName
New in version 19
CombinationFromName
CombinationFromName
Returns a combination of one or more options known by their names.
Versions 19 and later
CombinationFromValue
New in version 19
CombinationFromValue
CombinationFromValue
Returns a combination of one or more options known by their associated values.

Limits

The combinations are not available in dynamic compilation.
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment