PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Left function and UNICODE
  • Operating mode in GO mode and at run time
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
Extracts the left part (which means the first characters) from a character string or from a buffer.
WEBDEV - Browser code In this version, the left part of a buffer cannot be extracted.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 16
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 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps 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"
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppJavaPHPAjaxUser code (UMC)
// Extract the 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(<Source String> [, <Length>])
<Result>: Character string
  • Left part of <Source String>. Corresponds to <Source String> if <Length> is greater than the length of <Source String>.
  • EOT if <Length> is negative. A WLanguage error occurs (non-fatal error). To find out the error details, use ErrorInfo.
<Source String>: Character string (with quotes)
Character string whose 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 <Source String> without the space characters on the right.
Versions 16 and later
Universal Windows 10 App This parameter is mandatory in Windows Phone.
New in version 16
Universal Windows 10 App This parameter is mandatory in Windows Phone.
Universal Windows 10 App This parameter is mandatory in Windows Phone.
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppJavaPHPAjaxUser code (UMC)

Extracting the left part of a buffer Hide the details

<Result> = Left(<Source Buffer> [, <Size>])
<Result>: Character string
  • Left part of <Source Buffer>. Corresponds to <Source Buffer> if <Size> is greater than the size of <Source Buffer>.
  • EOT if <Size> is negative. A WLanguage error occurs (non-fatal error). To find out the error details, use ErrorInfo.
  • Invalid buffer if <Source Buffer> contains a character string in UNICODE format.
Windows Mobile Invalid buffer if <Source Buffer> contains a character string in UNICODE format.
<Source Buffer>: Buffer
Buffer whose 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 <Source Buffer> without the space characters on the right.
Windows Mobile In UNICODE, each character occupies two memory bytes. Therefore, the number of bytes is twice the number of characters.
Remarks

Left function and UNICODE

If the string passed in parameter is in ANSI format, the result will be in ANSI format.
If the string passed in parameter is in UNICODE format, the result will be in UNICODE format.
Reminder: In UNICODE, each character occupies two memory bytes. Therefore, the memory footprint of a UNICODE string is twice the number of characters actually found in the string.
The subscript of the first character in the string is set to 1.
Note: If the result on an ANSI string is assigned to a UNICODE string (and conversely), the conversion will be implicitly performed.
See Managing the UNICODE for more details.
Windows Mobile

Operating mode in GO mode and at run time

In GO mode (simulation on the development computer), when extracting the left part of a buffer (syntax 2), <Length> corresponds to the number of characters to extract (and not to the number of bytes).
For example, running the following code:
MyBuffer is Buffer = "WINDEV is tremendous"
Left(MyBuffer, 6)
The result is as follows:
  • in GO mode, returns "WINDEV".
  • at run time, returns "Win".
The differences between GO mode (simulator) and real use are presented in Differences between GO mode and real use.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
WEBDEV - Browser code WDJS.DLL
Java wd230java.jar
Linux wd230vm.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment