PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
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 for the truncated result.
  • the number of characters to truncate.
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> [, <Type of truncation>])
<Result>: Character string
  • Result of the truncation operation.
  • EOT if <Number of characters> is negative. A WLanguage error occurs (non-fatal error). To find out the error details, 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 stored in the <Result> string (the numberOfCharactersToStore constant is used).
  • the number of characters or bytes that must be deleted from the <Source> (the numberOfCharactersToDelete constant is used).
<Type of truncation>: Optional Boolean constant
Type of truncation to perform:
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 stored 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 deleted from <Source>.
Business / GUI classification : Neutral code
Component : wd250vm.dll
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment