PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

  • Generic search/Exact-match search
  • Performing a search on a composite key
  • Search on an array item
  • Search and filter
  • Locks
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Sets the position on the last data file record whose value for a specific item is less than or equal to a sought value. The record is not read.
The number of the current Record is changed only when it is returned by the <Source>.RecNum function. For the functions handling by default the number of the current Record (functions <Source>.Delete, <Source>.Read, <Source>.Modify, ...), the value of this number is not updated: you must use <Source>.RecNum(). For example: not to do:
Client.Supprime()
but
Client.Supprime(Client.NumEnr())
get is from the smallest to the largest value of the path heading (see notes for details).
Caution: The record loaded in memory is not modified. The HFSQL variables (Customer.Name for example, which means the Name item of Customer file) are not updated.
In general, the <Source>.SeekLast function is used to position oneself in the data file to perform a loop among the records corresponding to a condition. <Source>.Next is used to position on the next record corresponding to the condition.
Several cases may occur after the call to <Source>.SeekLast:
  • a record corresponding to the condition was found: function <Source>.Found returns True
  • the data file is empty or there is no record corresponding to the condition: function <Source>.Out returns True
Remarks:
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.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
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.

The reading is performed from the lowest value to the greatest value of search item (see the notes for more details).
Caution: The record loaded in memory is not modified. The HFSQL variables (Customer.Name for example, which means the Name item of Customer file) are not updated.
In general, the <Source>.SeekLast function allows you to position yourself in the data file to perform a loop among the records corresponding to a condition.
Several cases may occur after the call to <Source>.SeekLast:
  • a record corresponding to the condition was found, locked (if necessary) and loaded in memory: function <Source>.Found returns True.
  • the data file is empty or there is no record corresponding to the condition: <Source>.Out returns True.
  • the function tries to lock a record that is already locked in read-only: HErrorLock returns True and <Source>.Out returns True.
Remark: the search can be canceled by <Source>.CancelSeek.
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.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
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.
Example
// Recherche du dernier enregistrement pour lequel le nom du Client est Dupond
Client.RechercheDernier(Nom, "Dupond")
// Cet exemple permet de rechercher tous les clients
// ayant un chiffre d'affaires inférieur à une valeur donnée.
Client.RechercheDernier(ChiffreAffaires, X)
TANTQUE PAS Client.EnDehors()
AjouterClientListe()
Client.Précédent(ChiffreAffaires)
FIN
Syntax
<Result> = <Source>.SeekLast(<Key item> , <Sought value> [, <Options>])
<Result>: Boolean
  • True if the positioning on Record has been done (corresponds to the value of <Source>.Found).
  • False if a problem occurred. This problem can be caused by:
<Source>: Type corresponding to the specified source
Name of HFSQL data file used.
<Key item>: Character string
Name of key item on which the search will be performed.
<Sought value>: Type corresponding to the value
Value of sought item.
<Options>: Optional constant (or combination of constants)
Configures:
  • the lock mode applied to the sought record
  • the type of search performed.
hLockReadWriteLock in read/write: the record cannot be read or modified by another application.
OLE DB Lock in write-only. Operating mode equivalent to the hLockWrite constant.
hLockWriteLock in write mode: the record can be read by another application but it cannot be modified by another application.
hLockNoNo lock: the record can be read or modified by another application during the reading.
hGenericGeneric search (see the Notes)
An exact-match search is performed by default (constant not specified).
hLimitParsingThe browse will stop as soon as the last sought value is found. The current record will correspond to this last record found.
<Source>.Found will be set to False and <Source>.Out will be set to True.
This constant is used to optimize the search speed in Client/Server mode.
hKeepFilterThe path will take into account the filter set up with the <Source>.Filter function, even if the path key used is not optimized for the filter. Reminder: function <Source>.Filter returns the optimized path key for the filter.
Caution: In this case, performance issues may arise for large data files.
Hyper File 5.5 This variable cannot be used.
By default, the browse performed after <Source>.SeekLast ignores the filter.
Java Access by JDBC: This parameter is ignored.
OLE DBNative Connectors (Native Accesses) The lock options will have no effect if the locks are not supported by the OLE DB provider or by the Native Connector.
OLE DB The lock mode specified by <Source>.SeekLast will remain effective during the calls to <Source>.Previous and <Source>.Next.
To modify the lock mode, you must use:
Remarks

Generic search/Exact-match search

  • Generic search (mainly on the Character String items): Finds all records starting with the specified value.
    For example: When a generic search is performed on "Smith" (for the NAME item), all records whose Name item starts with "Smith" will match the search. Therefore, the record containing "Smither" will correspond to the search (HFound returns True).
  • Exact-match search: Finds all records that exactly correspond to the specified value.
    For example: When an exact-match search is performed on "Smith" (for the NAME item), HFound returns True for the records whose item exactly matches "Smith".
  • Examples or searches performed on CUSTOMER file sorted by name:
Sought valueOptions<Source>.SeekLast positions on recordHFound returnsHOut returnsExplanations
Durand6TrueFalseDurand exists.
The beginning of data file was not reached yet.
Dupuis5FalseFalseDupuis does not exist. Positioning on the first lower value (Moore).
The beginning of data file was not reached yet.
MoorhGeneric5TrueFalseMoor does not exist but the search is generic, and Moore is found (among others).
The beginning of data file was not reached yet.
MoorThe record was not found (no move)FalseFalseMoor does not exist.
The beginning of data file was not reached yet.
BernardThe record was not found (no move)FalseTrueBernard does not exist.
Positioning on the first lower value (this value does not exist): The beginning of data file was reached.

Performing a search on a composite key

Several methods can be used to perform a search on a composite key:
Using a list of values
The following syntax is used to perform a search on a composite key:
HRechercheDernier(<Nom du fichier>, <Nom de la clé composée>, ...
[<Valeur de recherche du premier élément de la clé composée>,
<Valeur de recherche du deuxième élément de la clé>, ...])
Example:
// Recherche de l'enregistrement
Client.RechercheDernier(Nom_Prénom, ["Moulin", "Françoise"])
Hyper File 5.5 To perform generic searches on a composite key, all the components of composite key must be Text components. Otherwise, an exact-match search is performed.

Search on an array item

The search is performed on the first array element (element whose subscript is 1). To perform a search on the other array elements, use the filters or queries.

Search and filter

If a filter is Active (function <Source>.Filter), the search takes into account the filter.
Hyper File 5.5 If a filter is enabled, the filter is ignored by the search.
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppiPhone/iPadJavaUser code (UMC)External languageAjaxHFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses)

Locks

The locks apply only when a record was found.
By default (no lock mode specified in <Options>), the record is not locked.
If a lock is requested (hLockWrite or hLockReadWrite constant), the record will be read only if this record is not already locked.
Reminder: A locked record can be unlocked by <Source>.UnlockRecNum.
OLE DBNative Connectors (Native Accesses) The lock options will have no effect if the locks are not supported by the OLE DB provider or by the Native Connector.
Component: wd270hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment