| 
 
| 
|  Author | Topic: Regional date format & fonts  (Read 290 times) |  |  
| 
| 
| dynamic35 New Member
 
 
 member is offline
 
  
 
 
 
 
  
 Gender:
  Posts: 34
 
 | 
|  | Regional date format & fonts « Thread started on: Aug 21st, 2012, 11:59am »
 |  |  In Europe  dates are in order:  dd/mm/yy
 In USA dates are mm/dd/yy. And in some EU countries there are two dots or small circle above a, o A O.
 In some cases date order makes an important  role since date like 02/12/2012 can be interpreted as 2nd of Dec 2012 (EU)  or 12th of Feb 2012 (USA).
 
 What is the method to clarify -as part of the bbc4w codes -the 'region' setting of windows computers, into which one  wants to install bbc4w programs.
 Ref
 There are code written by Richard that tells to you for example locations of op sys "special files" or there is a code to find out name of the Win op sys that  user employs.
 I cannot find from helps advice, how to feed into a real time BBC4W program flow the relevant format of user's  Windows region &date, ie the computer into into which I need to install an application , that is dependent on the order of the users' regional date format.
 Also similar problem might be investications on desimal separator a user has -for example   "," or "."  .
 
 Greetings
 Dynamic35
 |  
| 
|  |  Logged |  
 |  |  |  
| 
| 
| dynamic35 New Member
 
 
 member is offline
 
  
 
 
 
 
  
 Gender:
  Posts: 34
 
 | 
|  | Re: Regional date format & fonts « Reply #1 on: Aug 22nd, 2012, 05:47am »
 |  |  Code referenced in above story  So, I would like also to find the date format of the  PC . If you have that wisedom  please modify my program down here
 MODE 12
 CLS
 PRINT "         PC type and special Microsoft folders"
 PROCgetversion2
 PRINT "         OpSys="; D$; " (MS-id=";A%;B%;C%;")"
 
 PRINT "         Windows Directory  =";FNwindowsdirectory
 PRINT "         System Directory=";FNsystemdirectory
 PRINT "         FolderId"
 REM  my XP sp3 22.08.12
 id%=-1
 REPEAT
 id%=id%+1
 spex$=FNspecialfolder(id%)
 IF LENspex$ > 2 PRINT id%,TAB(14); spex$
 UNTIL id% = 99
 REM missing: a function to search date format (dd/mm/yy or mm/dd/yy) that is active now
 END
 
 REM 3 routines based on RR public samples
 DEF FNwindowsdirectory
 LOCAL T%
 DIM T% LOCAL 260
 SYS "GetWindowsDirectory", T%, 260
 = $$T% + "\"
 
 DEF FNsystemdirectory
 LOCAL T%
 DIM T% LOCAL 260
 SYS "GetSystemDirectory", T%, 260
 = $$T% + "\"
 
 DEF PROCgetversion2
 LOCAL osvi{}
 DIM osvi{Size%,     \ Size of structure
 \        Major%,    \ Major version number
 \        Minor%,    \ Minor Version number
 \        Build%,    \ Build number
 \        Platform%, \ Platform ID
 \        SP&(127)   \ Service Pack string
 \       }
 osvi.Size% = 148
 SYS "GetVersionEx", osvi{}
 A% = osvi.Major%
 B% = osvi.Minor%
 C% = osvi.Platform%
 D$="Unknown OpSystem"
 IF A%=4 AND B%=0 AND C%=1 THEN  D$="Windows 95"
 IF A%=4 AND B%=10 AND C%=1 THEN  D$= "Windows 98"
 IF A%=4 AND B%=90 AND C%=1 THEN  D$= "Windows Me"
 IF A%=4 AND C%=2 THEN  D$="Windows NT4"
 IF A%=5 AND B%=1 AND C%=2 THEN  D$="Windows XP"
 IF A%=5 AND B%=0 AND C%=2 THEN  D$="Windows 2000"
 IF A%=6 AND B%=1 AND C%=2 THEN  D$= "Windows 7"
 IF A%=6 AND B%=0 AND C%=2 THEN  D$= "Windows Vista"
 ENDPROC
 
 
 DEF FNspecialfolder(id%)
 LOCAL ppidl%, folder%, malloc%
 DIM folder% LOCAL 255
 SYS "SHGetSpecialFolderLocation", @hwnd%, id%, ^ppidl%
 SYS "SHGetPathFromIDList", ppidl%, folder%
 SYS "SHGetMalloc", ^malloc%
 SYS !(!malloc%+20), malloc%, ppidl%
 = $$folder% + "\"
 
 |  
| 
|  |  Logged |  
 |  |  |  
| 
| 
| admin Administrator
 
 
 member is offline
 
  
 
 
 
 
  
 
 Posts: 1145
 
 | 
|  | Re: Regional date format & fonts « Reply #2 on: Aug 22nd, 2012, 08:35am »
 |  |  on Aug 21st, 2012, 11:59am, dynamic35  wrote:
 | | What is the method to clarify -as part of the bbc4w codes -the 'region' setting of windows computers, into which one  wants to install bbc4w programs. | 
 | 
 Use the GetLocaleInfo API:
 
 Code:
       _LOCALE_SDECIMAL = &E
      _LOCALE_SLONGDATE = 32
      _LOCALE_USER_DEFAULT = &400
      
      DIM DateFormat{text&(80)}
      SYS "GetLocaleInfo", _LOCALE_USER_DEFAULT, _LOCALE_SLONGDATE, \
      \                    DateFormat{}, DIM(DateFormat{})
      PRINT "The user's date format is " DateFormat.text&()
      
      DIM DecimalSep{text&(4)}
      SYS "GetLocaleInfo", _LOCALE_USER_DEFAULT, _LOCALE_SDECIMAL, \
      \                    DecimalSep{}, DIM(DecimalSep{})
      PRINT "The user's decimal separator is " DecimalSep.text&() GetLocaleInfo will return all sorts of other region-dependent settings.  Check MSDN for details.
 
 Quote:
 | | I cannot find from helps advice, how to feed into a real time BBC4W program flow the relevant format of user's  Windows region &date | 
 | 
 The GetDateFormat API by default formats the date according to the user's preferences:
 
 Code:
       DATE_LONGDATE = 2
      _LOCALE_USER_DEFAULT = &400
      DIM Date{text&(80)}
      SYS "GetDateFormat", _LOCALE_USER_DEFAULT, DATE_LONGDATE, 0, 0, \
      \                    Date{}, DIM(Date{})
      PRINT Date.text&() You can alternatively specify DATE_SHORTDATE.
 
 Richard.
 |  
| 
|  |  Logged |  
 |  |  |  
| 
| 
| dynamic35 New Member
 
 
 member is offline
 
  
 
 
 
 
  
 Gender:
  Posts: 34
 
 | 
|  | Re: Regional date format & fonts « Reply #3 on: Aug 22nd, 2012, 10:41am »
 |  |  Excellent.  Thank you very much , again
 Dyna
 
 |  
| 
|  |  Logged |  
 |  |  |  
 |