ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / String functions
  • Spaces
  • CompleteDir and UNICODE
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Adds a directory separator ("\" or "/" according to the runtime platform) to the end of a string, if necessary.
This function is useful for building full file names when the path format is unknown (e.g., if the user types a file path).
It is also possible to build file paths directly with the / (slash) operator between components: the path will be automatically built dynamically with the expected format. Example:
Disque is string = "c:"
Répertoire is string = "Mes documents"
NomFichier is string = "SortieDeStock.xlsx"
CheminComplet is string
// La lisibilité du code est accrue
CheminComplet = Disque / Répertoire / NomFichier
New in version 2025
WEBDEV - Browser code This function is now available in browser code.
Example
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget JavaUser code (UMC)PHPAjax
Res is string
Res = CompleteDir(CheminFichier) + "Document.Doc"
Res = CompleteDir("c:\temp")           // Renvoie "c:\temp\"
Res = CompleteDir("c:\temp\")          // Renvoie "c:\temp\"
Res = CompleteDir("\CCS\\Rep2\user\")  // Renvoie "\CCS\\Rep2\user\"
Res = CompleteDir("")                  // Renvoie ""
WINDEVWEBDEV - Server codeLinux
Res is string
Res = CompleteDir(" /root/file ")      // Renvoie "/root/file/"
Res = CompleteDir("")                  // Renvoie ""
Syntax
<Result> = CompleteDir(<String to check>)
<Result>: Character string
  • String that ends in a directory separator.
  • Empty string if <String to check> corresponds to an empty string ("").
<String to check>: Character string
String to check and complete, if necessary. This character string is not modified.
Remarks

Spaces

Attention: Spaces before and after <String to check> are removed (identical to the NoSpace function).

CompleteDir and UNICODE

If the string passed as a parameter is an ANSI string, the result will be an ANSI string.
If the string passed in parameter is in Unicode format, the result will be in Unicode format.
Note If the result of the CompleteDir function used on an ANSI string is assigned to a Unicode string (and vice versa), ANSI/Unicode conversion will be implicitly performed.
For more details, see Unicode management.
Related Examples:
Handling text files Unit examples (WINDEV): Handling text files
[ + ] Handling "text" files with WINDEV:
- Create a text file
- Write into a text file
- Read in a text file
Handling text files Unit examples (WEBDEV): Handling text files
[ + ] This example explains how to handle "non HFSQL" files with WEBDEV and it allows you to:
- Create a text file
- Write into a text file
- Read in a text file
Handling text files Unit examples (WINDEV Mobile): Handling text files
[ + ] Handling external "text" files:
- Create a text file
- Write into a text file
- Read in a text file
Business / UI classification: Neutral code
Component: wd300vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help