PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

New WINDEV, WEBDEV, WINDEV Mobile 25 feature!
  • Automatic management of composite keys
  • Filter and filtered browse
  • Enabling/Disabling a filter
  • Data file not in HFSQL format
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
Defines and enables a filter used to find the exact value of a string item. This filter can be used on a data file, a view or a query.
After its execution, the most common cases are as follows:
  • the filter cannot be created: <Source>.FilterIdentical returns an empty string (""). HError returns the error identifier.
  • the filter is created: <Source>.FilterIdentical returns the optimized search key that will be used to browse the data file, view or query.
Versions 15 and later
Android This function is now available for Android applications.
New in version 15
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
Example
// Select all the customers whose last name is Archambault
// and whose first name is Colin
SearchKey is string
SearchKey = Customer.FilterIdentical(LastNameFirstName, "Archambault", "Colin")
Customer.ReadFirst(SearchKey)
WHILE NOT Customer.Out()
Trace(Customer.CustomerName, Customer.City)
Customer.ReadNext(SearchKey)
END
// Disables the filter
Customer.DeactivateFilter()
Syntax
<Result> = <Source>.FilterIdentical(<Key item> , <Value for key component 1> [, <Value for key component 2> [... [, <Value for key component N>]]])
<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 HFSQL data file, view or query used.
<Key item>: Character string (with or without quotes)
Name of key item onto which the filter will be applied. This item can be a simple key (string) or a composite key. Caution: this parameter must only contain letters, underlined characters or digits. Otherwise, the name must be enclosed in quotes.
<Value for key component 1>: Type of each component of search key
Value sought for the first component of composite key.
The type of this parameter must correspond to the type of key item component on which the filter is defined.
<Value for key component 2>: Type of each component of search key
Value sought for the second component of the composite key.
The type of this parameter must correspond to the type of key item component on which the filter is defined.
<Value for key component N>: Type of each component of search key
Value sought for component N of composite key .
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>.FilterIdentical automatically manages the filters on the simple keys and on the composite keys.
Example: Using <Source>.FilterIdentical with a simple key:
Res = Customer.FilterIdentical(LastName, "Archambault")
// Select the customer whose last name is Archambault
Example: Using <Source>.FilterIdentical with a composite key
Res = Customer.FilterIdentical(LastNameFirstName, "Archambault", "Colin")
// Select all the customers whose last name is Archambault and
// whose first name is Colin
This line of code is equivalent to:
Customer.Filter(LastNameFirstName, ...
Customer.BuildKeyValue(LastNameFirstName, "Archambault", "Colin"), ...  
Customer.BuildKeyValue(LastNameFirstName, "Archambault", "Colin")

Filter and filtered browse

After the call to <Source>.FilterIdentical, the data file must necessarily be browsed on the item returned by <Source>.FilterIdentical. The filter will be ignored if another item is used to browse 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 browse:
  • <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 or HOpenAnalysis for example).
  • A single filter can exist at a given time on a data file (query or view). If <Source>.FilterIdentical is used several times, only the last filter will be taken into account: the previous filters will be deleted. Similarly, if several filters are used (HFilter* functions), only the last filter will be taken into account.
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget Windows MobileAjaxUser code (UMC)Stored proceduresOLE DBNative Connectors (Native Accesses)

Data file not in HFSQL format

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