FutureBasic Logo

<<    Index    >> FutureBasic 5

def using   statement

def using [=] intlMoneyFormat&

This statement specifies how the Using function should interpret certain characters in its pattern string; this affects the format of the string returned by Using. The intlMoneyFormat& is specified by four characters packed into a long integer. The characters represent: the decimal point, the thousands separator, the list separator, and the currency symbol. After you execute Def Using, subsequent numbers formatted with Using are formatted as follows:
The following selects the U.S. numeric format (this is also the default if no Def Using statement has been executed):
Def Using = _".,;$"
The following selects the international numeric format as set by the system or selected by the user (this is the recommended numeric format to use):
Def Using = [[Fn GetIntlResource(0)]]

The international numeric format returned by Fn GetIntlResource may include a currency symbol which consists of more than one character. Def Using will pick up only the first character of the currency symbol.

Fn GetIntlResource is deprecated by Apple as of the introduction of MacOS X 10.5. The current recommended method to obtain items such as the currency symbol or decimal separator is to use Fn CFLocaleGetValue with an appropriate key such kCFLocaleDecimalSeparator or kCFLocaleCurrencySymbol.
See Also: