PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Left and UNICODE
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
Extracts the left part (i.e., the first characters) from a string or buffer.
Versions 15 and later
Android This function is now available for Android applications.
New in version 15
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android widget mode.
New in version 18
Android Widget This function is now available in Android widget mode.
Android Widget This function is now available in Android widget mode.
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
Left("The cuckoo", 6)   // Returns "The cu"
Left("ABC", 50)        // Returns "ABC"
Left("AZELMA ")        // Returns "AZELMA"
 
MyString is string = "Developing is child's play"
Left(MyString, 10)   // Returns "Developing"
Universal Windows 10 App
// Extract bytes
MyBuffer is Buffer = "Developing is child's play"
Left(MyBuffer, 10)   // Returns "Developing"
Syntax

Extracting the left part of a character string Hide the details

<Result> = Left(<Initial string> [, <Length>])
<Result>: Character string
  • Left part of <Initial string>. Corresponds to <Initial string> if <Length> is greater than the length of <Initial string>.
  • EOT if <Length> is negative. A WLanguage error occurs (non-fatal error). To get the details of the error, use ErrorInfo.
<Initial string>: Character string
Character string from which the left part will be extracted. This string is not modified.
<Length>: Optional integer
Number of characters to extract. If this parameter is not specified, <Result> corresponds to <Initial string> without trailing spaces.
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPadApple Watch

Extracting the left part of a buffer Hide the details

<Result> = Left(<Initial buffer> [, <Size>])
<Result>: Character string
  • Left part of <Initial buffer>. Corresponds to <Initial buffer> if <Size> is greater than the size of <Initial buffer>.
  • EOT if <Size> is negative. A WLanguage error occurs (non-fatal error). To get the details of the error, use ErrorInfo.
  • Invalid buffer if <Initial buffer> contains a UNICODE string.
<Initial buffer>: Buffer
Buffer from which the left part will be extracted. This buffer is not modified.
<Size>: Optional integer
Number of bytes to extract. If this parameter is not specified, <Result> corresponds to <Initial buffer> without trailing spaces.
Remarks

Left and UNICODE

If the string passed as a parameter is an ANSI string, the result will be an ANSI string.
If the string passed as a parameter is a UNICODE string, the result will be a UNICODE string.
Reminder: In UNICODE, each character occupies two bytes of memory. Therefore, the memory footprint of a UNICODE string is twice the number of characters actually contained in the string.
The fist character in the string is at index 1.
Remark: If the result on an ANSI string is assigned to a UNICODE string (and conversely), the conversion will be implicitly performed.
For more details, see Managing UNICODE.
Component: wd270vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment