Using Win32 functions in Visual FoxPro Image Gallery
National Language Support
..msdn
CompareString
GetACP
GetCurrencyFormat
GetDateFormat
GetLocaleInfo
GetNumberFormat
GetOEMCP
GetStringTypeEx
GetSystemDefaultLangID
GetSystemDefaultLCID
GetSystemDefaultLocaleName
GetThreadLocale
GetUserDefaultLangID
GetUserDefaultLCID
GetUserDefaultLocaleName
GetUserGeoID
LCIDToLocaleName
LocaleNameToLCID
NormalizeString
SetUserGeoID
Code examples:
CompareString
..msdn    Add comment     W32 Constants      Translate this page
Compares two character strings, for a locale specified by identifier.
Code examples:
Declaration:
 
int CompareString(
  _In_  LCID Locale,
  _In_  DWORD dwCmpFlags,
  _In_  LPCTSTR lpString1,
  _In_  int cchCount1,
  _In_  LPCTSTR lpString2,
  _In_  int cchCount2
);
 
FoxPro declaration:
 
DECLARE INTEGER CompareString IN kernel32;
    INTEGER Locale,;
    INTEGER dwCmpFlags,;
    STRING lpString1,;
    INTEGER cchCount1,;
    STRING lpString2,;
    INTEGER cchCount2
 
Parameters:
Locale [in]
Locale identifier of the locale used for the comparison.

dwCmpFlags [in]
Flags that indicate how the function compares the two strings.

lpString1 [in]
Pointer to the first string to compare.

cchCount1 [in]
Length of the string indicated by lpString1, excluding the terminating null character.

lpString2 [in]
Pointer to the second string to compare.

cchCount2 [in]
Length of the string indicated by lpString2, excluding the terminating null character.
Return value:
CSTR_LESS_THAN = 1
CSTR_EQUAL = 2 -- The two strings are equivalent for sorting purposes, although not necessarily identical.
CSTR_GREATER_THAN = 3
Usage:
 
cStr1 = "Acad้mie fran็aise"
cStr2 = "academie francaise"
 
nLocale = LOCALE_SYSTEM_DEFAULT
 
nFlags = BITOR(LINGUISTIC_IGNORECASE,;
    LINGUISTIC_IGNOREDIACRITIC)
 
? CompareString(;
    nLocale,;
    nFlags,;
    m.cStr1, LEN(m.cStr1),;
    m.cStr2, LEN(m.cStr2);
    )
 
My comment:
The usage example shows two strings, which are equivalent in lexical value in the context of chosen comparison flags.

#DEFINE LOCALE_CUSTOM_DEFAULT 0x0C00
#DEFINE LOCALE_CUSTOM_UI_DEFAULT 0x1400
#DEFINE LOCALE_CUSTOM_UNSPECIFIED 0x1000

#DEFINE LOCALE_INVARIANT 0x007F
#DEFINE LOCALE_SYSTEM_DEFAULT 0x0800
#DEFINE LOCALE_USER_DEFAULT 0x0400

#DEFINE LINGUISTIC_IGNORECASE 0x00000010
#DEFINE LINGUISTIC_IGNOREDIACRITIC 0x00000020
#DEFINE NORM_IGNORECASE 0x00000001

#DEFINE CSTR_LESS_THAN 1
#DEFINE CSTR_EQUAL 2
#DEFINE CSTR_GREATER_THAN 3
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
•
Created: 2014-12-30 11:31:39
Modified: 2014-12-30 11:46:10
Visited in last 7 days: 59
User Contributed Notes:
There are no notes on this subject.


Copyright ฉ 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.225.47.94)
3 sec.Function: 'InternetWriteFile'
6 sec.Function: 'getservbyport'
10 sec.Function: 'GetFileSize'
13 sec.Function: 'AttachVirtualDisk'
18 sec.Function: 'GdiFlush'
22 sec.Function: 'AddPrinter'
26 sec.Function: 'OpenSCManager'
30 sec.
Function group: 'Remote Access Service (RAS)'
34 sec.Function: 'DestroyPhysicalMonitors'
38 sec.Function: 'LoadIcon'
Google
Advertise here!