PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Simple description of a link
  • Advanced description of a 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.
Identifies, modifies or restores the file link of a control or group of controls.
ControlAlias does not modify the content of control, but only the link. To display the values corresponding to the new link, you must use FileToScreen, TableDisplay, ...
Note: ControlAlias is kept for backward compatibility: this function does not support the databinding. We recommend that you use ..FileLink.
Versions 18 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 18
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Example
// Identify the file link of "EDT_CustomerName"
ResFileLink = ControlAlias(EDT_CustomerName)
Syntax

Identifying the file link of a control Hide the details

<Result> = ControlAlias(<Control Name>)
<Result>: Character string
Description of file link for the specified control. This description has the following format:
"<Base File>.<Base Item>[:<Link>[:<Link>]]"
where <Link> corresponds to <Linked File>.<Key>:<Linked Item>[<Subscript>]
<Control Name>: Character string (with or without quotes)
Name of control to use.

Modifying the file link of a control or group of controls Hide the details

<Result> = ControlAlias(<Control Name> , <Description>)
<Result>: Integer
  • 0 if the modification was performed,
  • an error code (value greater than 0) otherwise.
<Control Name>: Character string (with or without quotes)
Name of control, group of controls, tab, browsing table, table column or window to use. The file links of all the controls found 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 window to use. The file links of all the controls found in the group, tab, browsing table, table column or window will be modified.
<Description>: Character string
New description of file link. If this parameter corresponds to an empty string (""), the file link is canceled. This description can correspond to:
  • an advanced description of file link for the control:
    "<Base File>.<Base Item>[:<Link>[:<Link>]]"
    <Link> corresponds to:
    <Linked File>.<Key>:<Linked Item>[<Subscript>]
  • a simple description of the link:
    "<New Base File> = <Current Base File>

Restoring the source file link of a control or group of controls Hide the details

<Result> = ControlAlias(<Control Name> , <caRestore>)
<Result>: Integer
  • 0 if the modification was performed,
  • an error code (value greater than 0) otherwise.
<Control Name>: Character string (with or without quotes)
Name of control, group of controls, tab, browsing table, table column or window to use. The file links of all the controls found 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 window to use. The file links of all the controls found in the group, tab, browsing table, table column or window will be restored.
<caRestore>: Constant
caRestore: Constant used to restore the source file link of a control or group of controls.
Remarks

Simple description of a link

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

Advanced description of a link

The description of file links has the following format:
"<Base File>.<Base Item>[:<Link>[:<Link>]]"
where <Link> corresponds to:
<Linked File>.<Key>:<Linked Item>[<Subscript>]
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 link
  • 7: Locked file or link not found
  • 10: File name too long
  • 11: Item name too long
  • 12: Too many links 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 a browsing Table control, only the following descriptions 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:
Components
WINDEVReports and Queries wd230obj.dll
WEBDEV - Server code wd230page.dll
Linux wd230page.so
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment