PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Simple link
  • Complex link
  • Error code (syntax 2 and 3)
  • Browsing Table control
  • Limitations and special cases
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
ControlAlias (Function)
In french: ChampAlias
Warning
From version 17, FieldAlias is kept for backward compatibility. This function is replaced by ControlAlias.
Gets, modifies or restores the data binding to a control or group of controls.
ControlAlias does not change the contents of the control, it only changes the data binding. To update the controls with the values of the new data binding, use FileToScreen, TableDisplay, etc.
Remark: ControlAlias is kept for backward compatibility: this function does not support the data binding. It is advisable to use the Property DataBinding.
Versions 18 and later
Linux This function is now available for WINDEV applications in Linux.
New in version 18
Linux This function is now available for WINDEV applications in Linux.
Linux This function is now available for WINDEV applications in Linux.
Example
// Identification de la liaison fichier du champ "SAI_NomClient"
ResLiaisonFichier = ControlAlias(SAI_NomClient)
Syntax

Getting the data binding of a control Hide the details

<Result> = ControlAlias(<Control used>)
<Result>: Character string
Linking the specified control file. This link is of the form:
"<Fichier de base>.<Rubrique de base>[:<Liaison>[:<Liaison>]]"
where <Binding> corresponds to <Related file>.<Key>:<Bound item>[<Index>]
<Control used>: Control name
Name of the control to be used.

Modifying the data binding of a control or group of controls Hide the details

<Result> = ControlAlias(<Element used> , <New binding>)
<Result>: Integer
  • 0 if the modification was performed,
  • an error code (value greater than 0) otherwise.
<Element used>: Control name, control group name or window name
Name of control, group of controls, tab, browsing table, table column or window to use. The data bindings of all the controls in the group, tab, browsing table, table column or window will be modified.
WEBDEV - Server code Name of control, group of controls, tab, browsing table, table column or page to use. The data bindings of all the controls in the group, tab, browsing table, table column or page will be modified.
<New binding>: Character string
New file link. If this parameter corresponds to an empty string (""), the data binding is canceled. This new link may correspond to:
  • or to a complex bond:
    "<Base file>.<Base item>[:<Binding>[:<Binding>]]"
    <Binding> corresponds to:
    <Related file>.<Key>:<Bound item>[<Index>]
  • or to a single bond:
    "<New base file> = <Current base file>

Restoring the initial data binding of a control or group of controls Hide the details

<Result> = ControlAlias(<Element used> , <caRestore>)
<Result>: Integer
  • 0 if the modification was performed,
  • an error code (value greater than 0) otherwise.
<Element used>: Control name, control group name or window name
Name of control, group of controls, tab, browsing table, table column or window to use. The data bindings of all the controls in the group, tab, browsing table, table column or window will be restored.
WEBDEV - Server code Name of control, group of controls, tab, browsing table, table column or page to use. The data bindings of all the controls in the group, tab, browsing table, table column or page will be restored.
<caRestore>: Constant
caRestore: Constant used to restore the initial data binding of a control or group of controls.
Remarks

Simple link

The description of a simple link corresponds to the syntax "<New base file> = <Current base file>".
In this case, only the controls bound to the items of the <Current base file> will be modified and bound to the <New base file>.
For example, the code line:
ControlAlias(FEN_Fenêtre, "CLIENT2001=CLIENT")
will rename the CUSTOMER file into CUSTOMER2001 for the controls whose base file is "CUSTOMER". The controls with a binding to another data file will not be modified.

Complex link

The description of a complex relationship corresponds to the syntax:
"<Fichier de base>.<Rubrique de base>[:<Liaison>[:<Liaison>]]"
where <Binding> corresponds to:
<Fichier relié>.<Clé>:<Rubrique reliée>[<Indice>]
This description corresponds to:

Error code (syntax 2 and 3)

If an error occurs, ControlAlias displays a message and returns an error code corresponding to this message:
  • 1: Syntax error
  • 2: Insufficient memory
  • 3: HFSQL files not initialized
  • 4: File not found
  • 5: Item or file not found
  • 6: Value of keys not found in the binding
  • 7: Locked file or binding not found
  • 10: File name too long
  • 11: Item name too long
  • 12: Too many bindings described
  • 13: Subscript allowed on last item only
  • 14: Subscript too high
  • 15: Invalid subscript value
  • 16: Type of control not valid with ControlAlias
  • 17: Description string too long
  • 18: Links not allowed on a browsing table
If a failure occurs when ControlAlias is used on a control, the previous link is not modified. If ControlAlias was applied to a group of controls, the control on which the error occurs and the following controls are not modified.

Browsing Table control

  • On an Table control file, only the following links are allowed:
    • <Base file>
    • <Base file>.<Base item>
  • <Base item> must correspond to a key item.
  • The file is replaced for all the table columns.
  • <Base item> applies to the table only.
  • ControlAlias only changes the link of the internal file on a browsing Table control.

Limitations and special cases

  • ControlAlias does not operate on the memory Table controls (and their columns), on the buttons and on the ActiveX controls.
  • It may happen that no browse is currently performed on the HyperFileSQL data files when an alias or a search key is modified. Once the file links have been changed by ControlAlias, we advise you to call:
Component: wd260obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment