PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
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.
Versions 19 and later
Windows Mobile This function is now available for the Windows Mobile applications.
New in version 19
Windows Mobile This function is now available for the Windows Mobile applications.
Windows Mobile This function is now available for the Windows Mobile applications.
Versions 20 and later
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 20
Universal Windows 10 App This function is now available for the Windows Phone applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
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.
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 <Length> 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>.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
Java wd230java.jar
Linux wd230vm.so
Android wd230android.jar
Minimum required version
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment