Home | Sign in | English EN
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
HAssign (Function)
In french: HAssigne
HFSQLAvailable only with this kind of connection
HAssgin is kept for backward compatibility (it will still be supported in the forthcoming version).
In version 8, HAssign was replaced by HChangeDir.
The documentation about HAssignKey available in WINDEV 5.5 is as follows.
Modify the access path of a data file.
HAssign(<File_Name>, <AccessPath>)
  • <FileName> is a character string containing the logical name of the data file.
  • <AccessPath> is the access path to the data file. This string contains up to 260 characters (uppercase and/or lowercase characters) containing the drive and the name of the directory of the data file. It does not contain the name of the data file.
HAssign modifies the access path to the data file on disk during the next call to a WINDEV function. The file will be opened in the specified path.
H.Dir contains the new path.
If <Access_Path>="?" (HAssign(<File_Name>,"?")), the file will be opened in the current directory.
If the file is opened before the call to HAssign, it is automatically closed.
  • In a program that is using HAssign and HCreation, the .REP must be managed in order for the data files to be updated after a modification of the structure of the files. By default, HSetDirOn is called.
  • HAssign must be used when the path and/or the name of the file on disk differ from the ones described in the analysis.
  • The logical name is the file name defined during the description of the file. The physical access path of the file is the path used to access the file on the hard disk.
  • HAssign cannot be used with the xBase files.
  • If the access path does not exist on disk, the error 24 is returned when the file is opened.
  • The path may contain (as in DOS) the . (to identify the current directory) and .. (to identify the previous directory).
  • If no directory is specified in <Access_Path>, it corresponds to the current directory.
  • HAssign is used to associate a directory with a file. To substitute a directory for another one, use HSubstDir.
    Caution: the change of directory performed by HSubstDir applies to the directory defined by HChangeDir.
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment