----- Original Message -----
From: "A. Razzak Memon" <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Thursday, March 06, 2008 3:12 PM
Subject: [RBASE-L] - Re: How To: Get the Users Country
>
> Simply Awesome!
Couldn't have done it without you and your exemplary staff!!
> Very Best R:egards,
>
> Razzak.
>
>
> At 03:06 PM 3/6/2008, MikeB wrote:
>
>>Did you know you can get the Users Country by calling the GetLocaleInfo API
>>using the NEW DLCall function?
>>
>>Here's how:
>>
>>{
>> only call STDCALL for this function ONCE per session
>> Fill the lplcdata variable with nulls the length of our pointer PTR to it
>>passed to the function
>> The function will populate the pointer variable with the country name
>>
>>}
>>STDCALL function 'GetLocaleInfoA' ALIAS 'GetLocaleInfo' (integer, ptr text
>>(48), integer, integer) : integer
>>
>>
>>SET VAR lplcdata TEXT = (SFIL((CHAR(0)),48))
>>
>>SET VAR USER_DEFAULT INTEGER = 1024
>>SET VAR sengcountry INTEGER = 4098 -- English name of country
>>SET VAR SENGLANGUAGE INTEGER = 4097 -- English name of language
>>SET VAR SNATIVELANGNAME INTEGER = 4 -- native name of language
>>SET VAR SNATIVECTRYNAME INTEGER = 8
>>
>>SET VAR i INTEGER = 0
>>
>>SET VAR i = (dlcall('Kernel32','GetLocaleInfo', 48, lplcdata,
>>SNATIVECTRYNAME,
>>USER_DEFAULT))
>>
>>PAUSE 2 USING .lplcdata
>>RETURN
>
>
>