ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / String functions
  • Miscellaneous
  • <ANSI string>.Complete and UNICODE
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns a character string of a specified length. This string can be truncated or padded with spaces (or any other character) to reach the specified length.
Example
MyString is string
MyString = "Alan"
MyString.Complete(8)        // Returns "Alan    "
MyString.Complete(8, "A")   // Returns "AlanAAAA"
MyString = "Alexander"
MyString.Complete(4)    // Returns "Alex"
Syntax
<Result> = <String to use>.Complete(<Length> [, <Character>])
<Result>: Character string
Character string of the specified length, padded or truncated.
  • If the length of <String to use> is less than <Length>, the string is padded on the right with spaces or with characters if the <Character> parameter is specified.
  • If the length of <String to use> is greater than <Length>, the string is truncated on the right (equivalent to Left).
<String to use>: ANSI character string
String to be padded or truncated. This character string is not modified.
<Length>: Integer
New length of the character string (greater than or equal to 0).
<Character>: Optional character
Character that will be used to pad the string. By default, this character corresponds to a space.
Remarks

Miscellaneous

  • A WLanguage error occurs if <Length> is less than 0.
  • The index of a string starts from 1.

<ANSI string>.Complete and UNICODE

<String to use> and <Character> can be both:
  • or ANSI format.
  • in Unicode format.
  • buffers.
You have the ability to use ANSI strings, Unicode strings and buffers in the different parameters of the function.
The following conversion rule is used for the Ansi systems (Windows or Linux):
  • If at least one of the strings is a buffer, all the strings are converted to buffers and the operation is performed with buffers.
  • If the first condition is not met and there is at least one Unicode string, all the strings are converted to Unicode and the operation is performed in Unicode (the conversion is performed with the current character set, if necessary).
  • Otherwise, the operation is performed in Ansi.
The conversion rule used for Unicode systems is as follows:
  • If at least one of the strings is a buffer, all the strings are converted to buffers and the operation is performed with buffers.
  • Otherwise, the operation is performed in Unicode.
For more details on Unicode, see Unicode management.
Remember: the language parameters used are defined when the ChangeCharset function is called.
Business / UI classification: Neutral code
Component: wd300vm.dll
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/26/2024

Send a report | Local help