Alaska Software Inc. - CDOW() on chinese OS()
Username: Password:
AuthorTopic: CDOW() on chinese OS()
AUGE_OHRCDOW() on chinese OS()
on Tue, 21 Jul 2009 16:19:46 +0200
hi,

   SET EPOCH TO YEAR( DATE() ) - 50
   SET CENTURY ON
   IF ID_CHINA
      SET DATE SYSTEM
      SET DATE FORMAT TO "mm-dd-yyyy"
   ELSE
      SET DATE GERMAN
      SET DATE FORMAT TO "dd.mm.yyyy"
   ENDIF

   CDOW((::FAHRBUCH)->DATUM)+" "+DtoC( (::FAHRBUCH)->DATUM )}

give me wrong Result (see picture)

greetings by OHR
Jimmy 




CDOW_CHINA.JPG
AUGE_OHRRe: CDOW() on chinese OS()
on Wed, 22 Jul 2009 05:18:34 +0200
@Alaska
Question : is CDOW() in XppRt1.DLL a Win API Function ?

does CDOW() work with other Codepage than
i can use with SET DATE or SET COLLATION ?

... i miss chinese

 greetings by OHR
Jimmy
AUGE_OHRRe: CDOW() on chinese OS()
on Thu, 23 Jul 2009 23:17:43 +0200
here is some Code to show what is wrong with Xbase++ XppNAT
(not perfect ... something at the end of right Picture ... CHR(0) ? )

*** Code ***
#include "DLL.CH"
#include "NLS.CH"
#include "winnls.ch"

DLLFUNCTION GetLocaleInfoA( nLanguage, nInfoType, @cData, nLenData ) using
stdcall from kernel32.dll

PROCEDURE MAIN
LOCAL x
   ShowNLS()
   ShowDLL()
RETURN

PROCEDURE ShowNLS()
LOCAL aSettings := { ;
  { "NLS_ICOUNTRY    " , NLS_ICOUNTRY     }, ;
  { "NLS_SLIST       " , NLS_SLIST        }, ;
  { "NLS_SDECIMAL    " , NLS_SDECIMAL     }, ;
  { "NLS_STHOUSAND   " , NLS_STHOUSAND    }, ;
  { "NLS_SCURRENCY   " , NLS_SCURRENCY    }, ;
  { "NLS_ICURRENCY   " , NLS_ICURRENCY    }, ;
  { "NLS_ICURRDIGITS " , NLS_ICURRDIGITS  }, ;
  { "NLS_SDATE       " , NLS_SDATE        }, ;
  { "NLS_IDATE       " , NLS_IDATE        }, ;
  { "NLS_ICENTURY    " , NLS_ICENTURY     }, ;
  { "NLS_STIME       " , NLS_STIME        }, ;
  { "NLS_ITIME       " , NLS_ITIME        }, ;
  { "NLS_S1159       " , NLS_S1159        }, ;
  { "NLS_S2359       " , NLS_S2359        }, ;
  { "NLS_SDAYNAME1   " , NLS_SDAYNAME1    }, ;
  { "NLS_SDAYNAME2   " , NLS_SDAYNAME2    }, ;
  { "NLS_SDAYNAME3   " , NLS_SDAYNAME3    }, ;
  { "NLS_SDAYNAME4   " , NLS_SDAYNAME4    }, ;
  { "NLS_SDAYNAME5   " , NLS_SDAYNAME5    }, ;
  { "NLS_SDAYNAME6   " , NLS_SDAYNAME6    }, ;
  { "NLS_SDAYNAME7   " , NLS_SDAYNAME7    }, ;
  { "NLS_SMONTHNAME1 " , NLS_SMONTHNAME1  }, ;
  { "NLS_SMONTHNAME2 " , NLS_SMONTHNAME2  }, ;
  { "NLS_SMONTHNAME3 " , NLS_SMONTHNAME3  }, ;
  { "NLS_SMONTHNAME4 " , NLS_SMONTHNAME4  }, ;
  { "NLS_SMONTHNAME5 " , NLS_SMONTHNAME5  }, ;
  { "NLS_SMONTHNAME6 " , NLS_SMONTHNAME6  }, ;
  { "NLS_SMONTHNAME7 " , NLS_SMONTHNAME7  }, ;
  { "NLS_SMONTHNAME8 " , NLS_SMONTHNAME8  }, ;
  { "NLS_SMONTHNAME9 " , NLS_SMONTHNAME9  }, ;
  { "NLS_SMONTHNAME10" , NLS_SMONTHNAME10 }, ;
  { "NLS_SMONTHNAME11" , NLS_SMONTHNAME11 }, ;
  { "NLS_SMONTHNAME12" , NLS_SMONTHNAME12 }  }

   CLS
   SET ALTERNATE TO NLS.TXT
   SET ALTERNATE ON
   AEval( aSettings, ;
            {|a| QOut( a[1], '"'+SetLocale( a[2] )+'"' ) } )
   SET ALTERNATE OFF
   SET ALTERNATE TO
RETURN

PROCEDURE ShowDLL()

   CLS
   SET ALTERNATE TO MYNLS.TXT
   SET ALTERNATE ON

            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_ICOUNTRY    )
; ? "NLS_ICOUNTRY     "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SLIST       )
; ? "NLS_SLIST        "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SDECIMAL    )
; ? "NLS_SDECIMAL     "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_STHOUSAND   )
; ? "NLS_STHOUSAND    "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SCURRENCY   )
; ? "NLS_SCURRENCY    "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_ICURRENCY   )
; ? "NLS_ICURRENCY    "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_ICURRDIGITS )
; ? "NLS_ICURRDIGITS  "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SDATE       )
; ? "NLS_SDATE        "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_IDATE       )
; ? "NLS_IDATE        "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_ICENTURY    )
; ? "NLS_ICENTURY     "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_STIME       )
; ? "NLS_STIME        "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_ITIME       )
; ? "NLS_ITIME        "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_S1159       )
; ? "NLS_S1159        "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_S2359       )
; ? "NLS_S2359        "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SDAYNAME1   )
; ? "NLS_SDAYNAME1    "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SDAYNAME2   )
; ? "NLS_SDAYNAME2    "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SDAYNAME3   )
; ? "NLS_SDAYNAME3    "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SDAYNAME4   )
; ? "NLS_SDAYNAME4    "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SDAYNAME5   )
; ? "NLS_SDAYNAME5    "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SDAYNAME6   )
; ? "NLS_SDAYNAME6    "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SDAYNAME7   )
; ? "NLS_SDAYNAME7    "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SMONTHNAME1 )
; ? "NLS_SMONTHNAME1  "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SMONTHNAME2 )
; ? "NLS_SMONTHNAME2  "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SMONTHNAME3 )
; ? "NLS_SMONTHNAME3  "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SMONTHNAME4 )
; ? "NLS_SMONTHNAME4  "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SMONTHNAME5 )
; ? "NLS_SMONTHNAME5  "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SMONTHNAME6 )
; ? "NLS_SMONTHNAME6  "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SMONTHNAME7 )
; ? "NLS_SMONTHNAME7  "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SMONTHNAME8 )
; ? "NLS_SMONTHNAME8  "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SMONTHNAME9 )
; ? "NLS_SMONTHNAME9  "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SMONTHNAME10)
; ? "NLS_SMONTHNAME10 "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SMONTHNAME11)
; ? "NLS_SMONTHNAME11 "+ x
            x := GetLocaleInfo( LOCALE_SYSTEM_DEFAULT, LOCALE_SMONTHNAME12)
; ? "NLS_SMONTHNAME12 "+ x

   SET ALTERNATE OFF
   SET ALTERNATE TO

RETURN

FUNCTION GetLocaleInfo( nLanguage, nInfoType )
**********************************************************

 Genius by Gnter Beyes, DANKE !!!
*
**********************************************************
local rc
local cData
local nLen

nLen := 50  nehmen wir mal an

cData := space( nLen )

rc := GetLocaleInfoA( nLanguage, nInfoType, @cData, nLen )

/*
Korrekterweise msste man die Lnge des Strings, der per Referenz zurck
erwartet wird, vorher ermitteln:

nLen  := GetLocaleInfoA( nLanguage, nInfoType, " ", 0 )
cData := space( nLen )

rc := GetLocaleInfoA( nLanguage, nInfoType, @cData, nLen )

*/

return left( cData, rc )

*** eof ***

@Alaska : Country Code is MORE than 2 Digit !!!

greetings by OHR
Jimmy 




CHINA_DATE_DBCS.JPG
AUGE_OHRRe: CDOW() on chinese OS()
on Sat, 25 Jul 2009 18:56:49 +0200
hi,

> (not perfect ... something at the end of right Picture ... CHR(0) ? )
yes it was a x0D so use STRTRAN(x,CHR(0),"") to get rid of the end

attach how Days have to look like and which LOCALE_ Konstante are used for

greetings by OHR
Jimmy 




TW886.JPG