ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Automatic management of composite keys
  • Filter and filtered iteration
  • Enabling/Disabling a filter
  • Non-HFSQL data files
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Defines and enables an "Included between" filter on a data file, view or query. The "Included Between" filter is used to select all the records included between two values.
After its execution, the most common cases are as follows:
  • the filter cannot be created: the function <Source>.FilterIncludedBetween FUNCTION function returns an empty string (""). HError returns the error identifier.
  • the filter is created: the <Source>.FilterIncludedBetween function returns the optimal route key to be used to route the data file, view or query.
Example
MaCléParcours is string
MaCléParcours = Client.FiltreComprisEntre(NomPrénom, ...
		"A", "B" + hMaxVal, hBoundSeparator, "C", "D" + hMaxVal)
// Sélection de tous les clients dont le nom est compris entre A et C
// et dont le prénom est compris entre C et D
Client.LitPremier(MaCléParcours)
WHILE NOT Client.EnDehors()
	Trace(Client.NomClient, Client.Ville)
	Client.LitSuivant(MaCléParcours)
END
...
// Désactive le filtre
Client.DésactiveFiltre()
Syntax
<Result> = <Source>.FilterIncludedBetween(<Key item> , <Lower bound of key component 1> [, <Lower bound of key component N> [... [, <Lower bound of key component 2>]]] , <hBoundSeparator> , <Upper bound of key component 1> [, <Upper bound of key component 2> [... [, <Lower bound of key component 2>]]])
<Result>: Character string
Browse item. Corresponds to:
  • the search key of data file if the filter is enabled.
  • an empty string ("") if the filter cannot be implemented.
<Source>: Type corresponding to the specified source
Name of data file, view or query used.
<Key item>: Character string
Name of key item onto which the filter will be applied. This item can be a simple key (string) or a composite key.
Warning: this parameter must only contain letters, underlined characters or numbers.. Otherwise, the name must be enclosed in quotes.
<Lower bound of key component 1>: Type of the first component of the search key
Lower bound for the components (first, second, etc.) of the composite key. The records corresponding to this value will be included in the filter.
The type of this parameter must correspond to the type of key item component on which the filter is defined.
<Lower bound of key component N>: Type of the second component of the search key
Lower bound for the second component of the composite key. The records corresponding to this value will be included in the filter.
The type of this parameter must correspond to the type of key item component on which the filter is defined.
<Lower bound of key component 2>: Type of the nth component of the search key
Lower bound for the nth component of the composite key. The records corresponding to this value will be included in the filter.
The type of this parameter must correspond to the type of key item component on which the filter is defined.
<hBoundSeparator>: Integer constant
The hBoundSeparator constant is used to separate the values of lower and upper bounds for the components of the composite key.
<Upper bound of key component 1>: Type of the first component of the search key
Upper bound for the components (first, second, ...) of composite key. The records corresponding to this value will be included in the filter.
The type of this parameter must correspond to the type of key item component on which the filter is defined.
<Upper bound of key component 2>: Type of the second component of the search key
Upper bound for the second component of the composite key. The records corresponding to this value will be included in the filter.
The type of this parameter must correspond to the type of key item component on which the filter is defined.
<Lower bound of key component 2>: Type of the nth component of the search key
Lower bound for the nth component of the composite key. The records corresponding to this value will be included in the filter.
The type of this parameter must correspond to the type of key item component on which the filter is defined.
Remarks

Automatic management of composite keys

<Source>.FilterIncludedBetween automatically manages the filters on the simple keys and on the composite keys.
Example: Using <Source>.FilterIncludedBetween with a simple key:
RésultatFiltre = Client.FiltreComprisEntre(Nom, "A", hBoundSeparator, "B" + hMaxVal)
// Sélection de tous les clients dont le nom est compris entre A et C
Example: Using <Source>.FilterIncludedBetween with a composite key
RésultatFiltre = Client.FiltreComprisEntre(NomPrénom, "A", "B" + hMaxVal, ...
		hBoundSeparator, "C", "D" + hMaxVal)
// Sélection de tous les clients dont le nom est compris entre A et C
// et dont le prénom est compris entre C et D
This line of code is equivalent to:
Client.Filtre(NomPrénom, ...
	Client.ConstruitValClé(NomPrénom, "A", "B" + hMinVal), ... 
	Client.ConstruitValClé(NomPrénom, "C", "D" + hMaxVal))

Filter and filtered iteration

After the call to <Source>.FilterIncludedBetween, the iteration must be performed on the item returned by <Source>.FilterIncludedBetween. The filter will be ignored if another item is used to loop through the data file.
When a filter is defined and enabled on a data file (view or query), all records read correspond to the filter. If no other record corresponds to the filter during the iteration:
  • <Source>.Out returns True.
  • the current record corresponds to the last record read with the filter.
For example:
On a filtered data file, after the function:the current record is:
<Source>.ReadFirstthe first file record corresponding to the filter
<Source>.ReadLastthe last file record corresponding to the filter
<Source>.ReadNext (or <Source>.Forward)the next record (or the next nth record) corresponding to the filter
<Source>.ReadPrevious (or <Source>.Backward)the previous record (or the previous nth record) corresponding to the filter

Enabling/Disabling a filter

  • <Source>.DeactivateFilter is used to disable a filter.
  • <Source>.ActivateFilter is used to re-enable a filter.
  • The filter is deleted when the data file (query or view) is closed (<Source>.Close for example).
  • A single filter can exist at a given time on a data file (query or view). If the <Source>.FilterIncludedBetween is used several times, only the last filter will be taken into account: the previous filter(s) will be deleted. Similarly, if several filters are used (HFilter* functions), only the last filter will be taken into account.
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)AjaxStored proceduresOLE DBNative Connectors (Native Accesses)

Non-HFSQL data files

Component: wd300hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help