PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Strings, Buffer and UNICODE
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
CommonLength (Function)
In french: TailleCommune
Returns the number of characters common to two characters strings (from the beginning or from the end).
Example
// Compare from the beginning
CommonLength("ABCDE", "ABXYZ")            // returns 2
// Compare from the end
CommonLength("VWXYZ", "ABXYZ", FromEnd) // returns 3
 
// Compare character by character
CommonLength("New York", "New Yorker")  // returns 8
// Compare by entire word
CommonLength("New York", "New York City", WholeWord)  // returns 8
 
// Compare while taking the case into account
CommonLength("ABCDE", "ABCdE")            // returns 3
// Compare while ignoring the case
CommonLength("ABCDE", "ABCdE", IgnoreCase) // returns 5
Syntax
<Result> = CommonLength(<String1> , <String2> [, <Options>])
<Result>: Integer
Length of the part common to the two strings.
<String1>: Character string (with quotes)
String to compare.
<String2>: Character string (with quotes)
String to compare.
<Options>: Optional integer constant
Indicates the options for comparison:
FromBeginningCompare from the beginning of the strings
FromEndCompare from the end of the strings
WholeWordCompare by entire word
IgnoreCaseCompare while ignoring the case
These constants can be combined.
By default, the comparison is performed from the beginning of the string, character by character, by taking the case into account.
Remarks

Strings, Buffer and UNICODE

CommonLength applies to the buffers, the strings and the UNICODE strings.
Caution: The IgnoreCase and WholeWord constants do not apply to buffers.
You have the ability to use ANSI strings, Unicode strings and buffers in the different parameters of the function.
The following conversion rule is used for the Ansi systems (Windows or Linux):
  • If at least one of the strings is a buffer, all the strings are converted into buffers and the operation is performed with buffers
  • otherwise, if at least one of the strings is in Unicode format, all the strings are converted into Unicode and the operation is performed in Unicode,
  • otherwise, the operation is performed in Ansi format.
The following conversion rule is used for the Unicode systems (Windows CE):
  • If at least one of the strings is a buffer, all the strings are converted into buffers and the operation is performed with buffers,
  • otherwise, the operation is performed in Unicode.
Business / UI classification : Neutral code
Component : wd250vm.dll
Minimum version required
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment