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/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 25 and later
WEBDEV - Browser code This function is now available in browser code.
New in version 25
WEBDEV - Browser code This function is now available in browser code.
WEBDEV - Browser code This function is now available in browser code.
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 more details on the error, use ErrorInfo.
<Source>: Character string or Buffer
Element to use: 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
numberOfCharactersToDelete
New in version 18
numberOfCharactersToDelete
numberOfCharactersToDelete
<Number of characters> corresponds to the number of characters that must be removed from <Source>.
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.
Business / UI classification: Neutral code
Component: wd270vm.dll
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment