PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Various
  • Complete function and UNICODE
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
Returns a character string of a given size. This string can be truncated or filled with space characters (or any other character) to reach the required size.
Example
Complete("Alan", 8)        // Returns "Alan    "
Complete("Alan", 8, "A")   // Returns "AlanAAAA"
Complete("Alexander", 4)    // Returns "Alex"
Syntax
<Result> = Complete(<String to Complete> , <Size> [, <Character>])
<Result>: Character string
Character string of the specified size, completed or truncated.
  • If the length of <String to Complete> is less than <Length>, the string is completed on the right by spaces or by specific characters if the <Character> parameter is specified.
  • If the length of <String to Complete> is greater than <Length>, the string is truncated on the right (equivalent to Left).
<String to Complete>: Character string
Initial character string to complete or to truncate. This character string is not modified.
<Size>: Integer
New length of character string (greater than or equal to 0).
<Character>: Optional character
Character used to fill the string. This character corresponds to a space character by default.
Remarks

Various

  • A WLanguage error occurs if <Size> is less than 0.
  • By convention, the first subscript of a character string is set to 1.

Complete function and UNICODE

<String to Complete> and <Character> can both be:
  • in 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):
  • It at least one of the strings is a buffer, all the strings are converted into buffers and the operation is performed with buffers,
  • otherwise, if at least one of the strings is in Unicode format, all the strings are converted into Unicode and the operation is performed in Unicode,
  • otherwise, the operation is performed in Ansi format.
The following conversion rule is used for the Unicode systems (Windows CE):
  • It at least one of the strings is a buffer, all the strings are converted into buffers and the operation is performed with buffers,
  • otherwise, the operation is performed in Unicode.
Note: If the result on an ANSI string is assigned to a UNICODE string (and conversely), the conversion will be implicitly performed.
See Managing the UNICODE format for more details.
Component : wd240vm.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