$if 0
    ķ                        PowerBASIC v3.20
 Ĵ          DASoft          ķ
   Ķ    Copyright 1995     DATE: 1995-10-01 ķ
    FILE NAME   INTRNATS.TXT           by            
                               Don Schullian, Jr.                      
   ͼ                                          
  A license is hereby granted to the holder to use this source code in   
  any program, commercial or otherwise,  without receiving the express   
  permission of the copyright holder and without paying any royalties,   
  as long as this code is not distributed in any compilable format.      
   IE: source code files, PowerBASIC Unit files, and printed listings    
 ͼ 
                   ....................................                   
   ͼ
$endif

'......................................
'                                      

Several functions in this library provide international support. DOS, too,
provides some of this support but stops VERY short of doing a complete job.
If DOS supports the particular country you need, then it will provide you
with all the information you need to use all these routines except the lower
case conversion table.

The only time you need to change the system's country code is if your
program requires the use of fUCASEchar?, fUCASEdos$ or UCASEdos for ASCII
codes > 127. If you do this, however, please don't forget to set it back to
it's original settings before ending your program:)

As all of these routines can be found on page 11 of the help menu and that
most of them are very straight forward anyhow I will not go into lengthy
explanations here. The only thing that MAY become confusing is the casing
routines and how they work. Regardless of whose casing routines you use,
PowerBASIC, DOS, or ours, the characters < CHR$(128) are considered standard
ASCII and will always be treated the same. It is the last half of the ASCII
set that changes with each country.

PowerBASIC's UCASE$ and LCASE$ seem to be fixed to the 437(US) code page.
DOS's UCASE routines seem to be fixed with whichever country the user has
loaded at start-up.

Our routines default to 437(US) to match PowerBASIC but can be changed at
any time by sending a 128 character string with the "converted" letters in
the position of the characters to be changed. The 3 strings below use the
lower ASCII values to demonstrate how Upper$ and Lower$ need to be built
before calling SetUpperCase and SetLowerCase. Of course the real thing will
start with CHR$(128) and proceed through CHR$(255).

ASCII="789;:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz"
U$   ="789;:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ"
L$   ="789;:<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz"


fSetCountry%                                             DOS support
fGetCountry$      CountryCodeTYPE                       
fGetCollate$      fGetUCASE$                            
fUCASEchar?       fUCASEdos$          UCASEdos          
'Ĵ
pbvUsingChrs                                             PowerBASIC
'Ĵ
SetUpperCase      fUCASE$             UCASEstr          
SetLowerCase      fLCASE$             LCASEstr          
SetMoneyMask      fMoney$                               
SetDateFormat     all DASsoft date$ routines            
SetTimeFormat     all DASsoft time$ routines             DASoft routines

It is NOT mandatory that your programs conform to DOS's idea of which
countries are to be supported! Many countries that are NOT supported by DOS
and the code pages have their own routines that load their characters, key-
board drivers, code pages, etc. By building a small data-base of this info
or by allowing your users the opportunity to make their own choices your
programs can service almost everyone, everywhere!

'......................................
'                                      
'......................................
'                                      

Try this code at the top of your programs:

PUBLIC pCollate$                              ' so it can be used everywhere
SetupCCstuff

SUB SetupCCstuff () LOCAL PUBLIC
  LOCAL U$

  DIM tCC AS CountryCodeTYPE
  LSET tCC  = fGetCountry$( 0 )                 ' current setting
  U$        = fGetUCASE$                        ' DOS's ucase   128 chars
  pCollate$ = fGetCollate$                      ' DOS's collate 256 chars
  MID$( pbvUsingChrs, 3, 2 ) = CHR$(tCC.ThousandSep, tCC.DecimalSep)
  SetDateFormat tCC.DateFormat , tCC.DateSep
  SetTimeFormat tCC.TimeFormat , tCC.TimeSep
  SetMoneyMask  tCC.MoneySymbol, tCC.MoneyFormat, tCC.MoneyDecs
  SetUpperCase  U$

END SUB

'......................................
'                                      

PowerBASIC does provide an easy way to UCASE and/or LCASE a string.

pLower$ = "abcdefghijklmnopqrstuvwxyz"               ' public variables
pUpper$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"               '
REPLACE ANY pLower$ WITH pUpper$ IN Txt$             ' ucase
REPLACE ANY pUpper$ WITH pLower$ IN Txt$             ' lcase
