ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / String functions
  • Miscellaneous
  • Complete and UNICODE
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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
Complete("Alan", 8)        // Returns "Alan    "
Complete("Alan", 8, "A")   // Returns "AlanAAAA"
Complete("Alexander", 4)    // Returns "Alex"
Syntax
<Result> = Complete(<String to use> , <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>: 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.

Complete and UNICODE

<String to use> and <Character> can be both:
  • ANSI.
  • UNICODE.
  • 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 Managing UNICODE.
Reminder: The linguistic parameters used are defined during the call to ChangeCharset.
Business / UI classification: Neutral code
Component: wd290vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo Complete

SAI_resultado+="1" // TIPO DE REGISTRO // 001 a 001
SAI_resultado+=Complete("",16) // 02 a 017
SAI_resultado+=Complete(SAI_texto,25) // 018 a 030
SAI_resultado+=CR
SAI_resultado+="2" // TIPO DE REGISTRO // 001 a 001
SAI_resultado+=CR
SAI_resultado+="3" // TIPO DE REGISTRO // 001 a 001


//Blog com video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/03/curso-windev-string-006-string-complete.html
De matos AMARILDO
09 Mar. 2016

Last update: 03/31/2023

Send a report | Local help