PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
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
Truncates the right part of a string or buffer. You can specify:
  • the number of characters of the truncated string.
  • the number of characters to be removed.
Example
sString is string = " Turlututu"

// Truncate the string to 9 characters
Trace(Truncate(sString, 9)) // Displays " Turlutut"
Trace(Truncate(sString, 9, numberOfCharactersToStore))  // Displays " Turlutut"

// Truncate the string to 4 characters
Trace(Truncate(sString, 4, numberOfCharactersToDelete))
// Displays " Turlu"
Syntax
<Result> = Truncate(<Source> , <Number of characters> [, <Truncate method>])
<Result>: Character string
  • Truncated string.
  • EOT if <Number of characters> is negative. A WLanguage error occurs (non-fatal error). To get the details of the error, use ErrorInfo.
<Source>: Character string (with quotes) or buffer
Element to use: Character string or buffer. This element is not modified.
<Number of characters>: Integer
Corresponds to:
  • the number of characters that must be kept in the <Result> string (if the numberOfCharactersToStore constant is used).
  • the number of characters or bytes that must be removed from <Source> (if the numberOfCharactersToDelete constant is used).
<Truncate method>: Optional Boolean constant
Truncate method to use:
Versions 18 and later
numberOfCharactersToStore
(Default value)
New in version 18
numberOfCharactersToStore
(Default value)
numberOfCharactersToStore
(Default value)
<Number of characters> corresponds to the number of characters that must be kept in the <Result> string.
Versions 18 and later
numberOfCharactersToDelete
New in version 18
numberOfCharactersToDelete
numberOfCharactersToDelete
<Number of characters> corresponds to the number of characters that must be removed from <Source>.
Business / UI classification: Neutral code
Component: wd260vm.dll
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment