Steven Black Consulting -- Resources for Visual FoxPro developers and other object-oriented programming professionals

A Survey of VFP's International Features

Many Visual FoxPro commands have international nuances. This is fully documented in the INTL Toolkit. Below is the documentation on international issues for VFP commands. Keep these things in mind as you develop your international applications.

Pick the first letter of a VFP keyword, or just scroll down.

Background
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Background

This section is a compendium of VFP's international features and dependencies. It is a long and detailed section, though fortunately many of the themes are recurring. Here is a short summary of the main themes found herein:

The language of operating system services will vary with the localized language of the OS.
  • Some services come from the operating system, so the language of display varies with the localization of the operating system. For example, if your German client is running a US version of Windows, then VFP's MESSAGEBOX() function will display English button captions (OK - Cancel) and there is nothing you can do about it (other than use INTL's MsgSvc() function, of course).
The language of native VFP services will vary with the localized language of VFP.
  • Some services come from Visual FoxPro, so their display language varies with the localized version of VFP. For example, dialogs like GETFILE() and LOCFILE() are VFP dialogs, and aside from parameters you can pass, these dialogs will appear in English on English versions of VFP.
The language of some things in VFP cannot be controlled.
  • Some VFP services aren't designed for multi-locale use, like the Relational Integrity (ri) builder. The ri builder is dependent on FoxPro functions that return character strings that vary with the localized version of FoxPro.
The language of third-party services cannot be predicted without experimentation.
  • Some services come from third-parties, and their localization usually cannot be predicted unless you experiment. Things like OLE custom controls, for example, may or may not be internationally enabled, and may require separate versions (if available) for different locales.

A Recurring Theme

Here are a few things to keep in mind. These apply to many of the topics that follow.

These "AS nCodePage" elements recur in many of the topics below, and they are listed here just once. Keep these factors in mind.
  • Wherever you see nCodePage in a command description, you can use GETCP()to display the Code Page dialog box, allowing you to specify a code page for the imported table or file.
  • In general, in cases where a nCodePage argument is permitted and a value of 0 is assigned, no code page translation will take place.
  • If the specified value for nCodePage isn't supported, VFP generates error 1914, with message "Code page number is invalid.".

Top | Home


AERROR(ArrayName)

Creates an array of information about the most recent VFP, OLE, or ODBC error.

VFP errors vary with the localization language of VFP. When a VFP error occurs, ArrayName[2] contains the text of the error message, which is the same as the value returned by MESSAGE().

Internationalization Gotcha: This error message varies according to the localized version of VFP.

OLE error messages vary with the localization language of Windows. When OLE errors numbered 1427 or 1429 occur, then ArrayName[2] contains the text of the VFP error message ("OLE Idispatch exception code"), and ArrayName[3] contains the text of the OLE error message.

Internationalization Gotcha: The VFP error message varies with the localization of VFP, and the OLE error message usually varies with the localization of Windows.

ODBC error messages vary with the localized language of VFP. Similarly, when an ODBC error numbered 1526 occurs , then ArrayName[2] contains the text of the VFP error message ("Connectivity error:"), and ArrayName[3] contains the text of the ODBC error message.

Internationalization Gotcha: Both the VFP and ODBC error messages vary with the localization of VFP.

Obviously, you'll want to avoid passing AERROR() messages to the user unless you are sure that their workstation has the correct localized versions of Windows and VFP.

Top | Home


AFIELDS(ArrayName [, nWorkArea | cTableAlias])

AFIELDS() places structural information about the current table into an array.

Of note to international developers is the following:

Internationalization Gotcha: ArrayName[6] contains logical true if code page translation is not allowed. Think of this as a NOCPTRANS flag for the field.

Internationalization Gotcha: ArrayName[8] contains the field validation text, which will probably need to be localized.

Internationalization Tip: you can set the field validation text with DBSETPROP(cTableAlias,"Field","RuleText", cRuleText).

Internationalization Gotcha: ArrayName[11] contains the table validation text, which will probably need to be localized.

Internationalization Tip: you can control the table validation text with DBSETPROP(cTableAlias,"Table","RuleText", cRuleText).

Top | Home


ANSITOEM(cExpression)

ANSITOOEM() is for backward compatibility and for conversions with DOS. Use CPCONVERT() instead. ANSITOOEM() converts each character of a character expression to the corresponding character in the ms-dos (oem) character set. ANSITOOEM()is used to move data from VFP and FoxPro for Macintosh to FoxPro for ms-dos.

Internationalization Tip: this function is included for backward compatibility. Use CPCONVERT() instead.

Top | Home


APPEND FROM ... AS nCodePage

Specify the codepage of the new data when appending table data from other locales or platforms. APPEND FROM adds records to the end of the currently selected table from another file.

Internationalization Gotcha: the optional AS nCodePage argument specifies the code page of the source table or file. As VFP appends the data, it automatically converts the data to the code page of the current table.

If you omit AS nCodePage, two things can happen:

  1. If VFP cannot determine the code page of the source table or file, VFP copies the contents of the source table or file, and, as it copies the data, automatically converts the data to the current VFP code page. If SET CPDIALOG is ON, the table in the currently selected work area is marked with a code page. If you're appending from a table not marked with a code page, the Code Page dialog is displayed, allowing you to choose the code page of the table from which you're appending. The current VFP code page can be determined with CPCURRENT( ).
  2. If VFP is able to determine the code page of the file being appended, VFP copies the contents of the appended table or file, and, as it copies the data, automatically converts the data to the code page of the currently selected table.

Top | Home


APPEND MEMO ... AS nCodePage

APPEND MEMO copies the contents of a disk file to a memo field.

Specify the codepage of the new data when appendingmemo field data from other locales or platforms.

Top | Home


APPEND PROCEDURES ... AS nCodePage

APPEND PROCEDURES appends stored procedures in a text file to the stored procedures snippet of the current database.

Specify the codepage of the new data when appending DBC procedure code from other locales or platforms Internationalization Gotcha: AS nCodePage specifies the code page of the text file from which the stored procedures are appended. VFP copies the contents of the text file, and, as it does so, automatically converts the contents of the text file to the code page you specify

If you omit AS nCodePage, VFP copies the contents of the text file from which the stored procedures are appended, and, as it does so, automatically converts the contents of the text file to the current VFP code page. The current VFP code page can be determined with CPCURRENT( ).

Top | Home


AT_C(cSearchExpression, cExpressionSearched [, nOccurrence])

AT_C() is similar to AT(), but works with single and double-byte characters.

Top | Home


ATCC(cSearchExp, cExpSearched [, nOccurrence])

ATCC() is like ATC(), and works with single and double-byte characters.

Top | Home


ATCLINE(cSearchExpression, cExpressionSearched)

There is no ATCLINEC() function in VFP 3.0b as one might expect. ATCLINE() returns the line number of the first occurrence of a character expression or memo field within another character expression or memo field, without regard for the case (upper or lower) of the characters in either expression.

Internationalization Tip: ATCLINE()works with both single-byte and double-byte character sets.

Top | Home


ATLINE(cSearchExpression, cExpressionSearched)

There is no ATLINEC() function in VFP 3.0b as one might expect. ATLINE() returns the line number of the first occurrence of a character expression or memo within another character expression or memo.

Internationalization Tip: ATLINE()works with both single-byte and double-byte character sets.

Top | Home


BROWSE

BROWSE without NOMENU leads to an unlocalizable "Table" menu pad. Internationalization Gotcha: when using BROWSE without a NOMENU clause, VFP places a "Table" menu pad on the system menu containing a number of bars (with captions like "Properties", "Font", "Go to record", etc). The display language of this pad and its bars is a function of VFP's localization language. In international applications that use BROWSE, make sure you make it a BROWSE...NOMENU and, if required, invoke your own supporting menu.

Top | Home


CDOW(dExpression | tExpression)

CDOW() is dependent on the VFP localization. CDOW()returns the day-of-the-week from a given date or datetime expression.

Internationalization Gotcha: the day name returned varies with the localization of VFP.

Top | Home


CHR()

Using CHR(n) instead of the character itself is a good way to prevent code page translation. CHR() returns the character associated with the specified numeric ANSI code.

Internationalization Tip: you can use CHR() to prevent VFP's automatic code page translation. This is useful for program files which are not marked with code pages ID's. This may save you if you omit the AS nCodePage argument found in many VFP commands.

Top | Home


CHRTRANC(cSearched, cSearchFor, cReplacement)

CHRTRANC() is like CHRTRAN() and works with single and double-byte characters. CHRTRANC(), which is similar to CHRTRAN(), replaces each character in a character expression that matches a character in a second character expression with the corresponding character in a third character expression. As you might expect, CHRTRANC()adjusts for single-byte and double-byte characters automatically.

Internationalization Tip: to enable your application for DBCS, always use CHRTRANC()wherever you might use CHRTRAN().

Top | Home


CMONTH(dExpression | tExpression)

The text returned from CMONTH() varies with the localized version of VFP. CMONTH()returns the name of the month from a given date or datetime expression.

Internationalization Gotcha: the language of the returned string comes from VFP, so you cannot independently control the language of what's returned.

Top | Home


COMPILE ... AS nCodePage

Use COMPILE...AS or SET CPCOMPILE to compile source files originating from other locales or platforms COMPILE compiles one or more source files.

Internationalization Gotcha: the optional AS nCodePage specifies the code page for which the program is compiled. The code page you specify with AS nCodePage overrides the global compilation code page specified with SET CPCOMPILE.

Top | Home


COPY MEMO ... AS nCodePage

Use AS <code page> to create a file-copy of a memo in another code page COPY MEMO copies the contents of the specified memo field in the current record to a file.

Internationalization Gotcha: AS nCodePage specifies the code page for the new file VFP copies the contents of the specified memo field, and, as it copies the data, automatically converts the data to the code page you specify for the text file.

Top | Home


COPY STRUCTURE EXTENDED

COPY STRUCTURE EXTENDED exports NOCPTRANS information, and data that may need to be localized COPY STRUCTURE EXTENDED creates a new table with fields containing the structure of the currently selected table.

Internationalization Gotcha: this new table will contain the following notable fields which have internationalization implications.
FIELD_NOCP L Code page translation not allowed (character and memo fields only)
FIELD_ERR M Field validation text
TABLE_ERR M Table validation text

Top | Home


COPY TO ... AS nCodePage

COPY TO creates a new file from the contents of the currently selected table.

Internationalization Gotcha: AS nCodePage specifies the code page for the new file. VFP copies the contents of the currently selected table, and, as it copies the data, automatically converts the data to the code page you specify for the new table or file. If possible, VFP marks the newly created table or file with the code page you specify. If you omit AS nCodePage, the newly created table or file is converted to the current VFP code page.

Top | Home


COPY PROCEDURES ... AS nCodePage

COPY PROCEDURES copies stored procedures in the current database to a text file.

Internationalization Gotcha: the AS nCodePage specifies the code page for the text file to which the stored procedures are copied. VFP copies the stored procedures, and, as it does so, automatically converts the stored procedures to the code page you specify.

Top | Home


CPCONVERT(nCurrentCodePage, nNewCodePage, cExpression)

CPCONVERT() is used to transform character or memo data.

CPCONVERT() converts character or memo fields or character expressions to another code page.

Internationalization Gotcha: don't forget to use CPCONVERT() when moving strings from one platform or locale to another.

Top | Home


CPCURRENT([1 | 2])

Use CPCURRENT() to reckon system code page information.

In VFP, the current operating system code page if the CODEPAGE configuration item isn't included in your configuration file. In previous versions of FoxPro, 0 is returned if the CODEPAGE configuration item isn't included in your configuration file.

  • The code page number specified in the CODEPAGE= configuration item in CONFIG.FPW.
  • The current operating system code page if you have included the following line in your configuration file: CODEPAGE = AUTO

In VFP, CPCURRENT(1) returns the Windows code page, regardless of your configuration CODEPAGE setting.

CPCURRENT(2) always returns the underlying operating system code page, regardless of your configuration CODEPAGE setting. For example, if you're running Windows, CPCURRENT(2) returns the MS-DOS code page.

Top | Home


CPDBF([nWorkArea | cTableAlias])

CPDBF() gives table code page information. CPDBF()returns the code page of an open table.

Internationalization Gotcha: don't assume that a table is marked with the correct code page, especially if it comes from another platform or another locale.

Top | Home


CPZERO( cFilename[, codepage_number]]

Use CPZERO.PRG to change a table's code page id. Assuming you've installed tools, CPZERO.PRG can be found in your TOOLS\CPZERO directory. CPZERO.PRG removes the code page mark from any file that has a table file structure. After removing the mark, CPZERO applies another mark that you specify.

Internationalization Gotcha: if tables do not have code page marks when you open them, VFP prompts you for a code page. If you specify the wrong code page, however, the data in the files won't display properly. To correct the code page, use CPZERO.

CPZERO.PRG won't fix a corrupted table. It is worth noting that CPZERO won't fix a file with data corruption resulting from prior automatic code page translation.

Top | Home


CREATE CURSOR ... NOCPTRANS

CREATE CURSOR - SQL creates a temporary table. The NOCPTRANS argument, which applies when specifying field-level attributes, prevents translation to a different code page for character and memo fields.

Internationalization Gotcha: use the NOCPTRANS if conversion to another code page is anticipated. Note that this is more likely if a subset of the temporary table is saved to disk.

Top | Home


CREATE TABLE ... NOCPTRANS

CREATE TABLE - SQL creates a table.

Internationalization Gotcha: the NOCPTRANS field-level argument prevents translation to a different code page for its character and memo fields.

Top | Home


CTOD(cExpression)

If your date format doesn't match SET DATE, no error is generated, and a blank date value ( / / ) results. CTOD() converts a character expression to a date expression.

Internationalization Gotcha: remember that the format for the character expression must conform to the date format specified by SET DATE or by the "International" page of the Options dialog. So the command CTOD("9/24/96" ) works if SET DATE AMERICAN (month-day-year) but creates an empty date value ( / / ) if SET DATE BRITISH (day-month-year) or SET DATE JAPAN (year-month-day).

Arguments passed to CTOD() are unaffected by SET MARK TO. It is worth noting that CTOD() doesn't care about current date delimiters specified by SET MARK TO or by the "International" page of the Options dialog, so CTOD("9/24/96"), CTOD("9-24-96") and CTOD("9.24.96") all work equally well.

Top | Home


CTOT(cExpression)

If your date format doesn't match SET DATE, no error is generated, and a blank value ( / / : : AM ) results. CTOT() returns a DateTime value from a character expression.

Internationalization Gotcha: Remember that, like CTOD(), the format for the character expression must conform to the date format specified by SET DATE or by the "International" page of the Options dialog.

The proper format for cCharacterExpression is determined by the current settings of SET DATE, SET HOURS, and SET MARK. CCharacterExpression must evaluate to a recognizable DateTime value or Visual FoxPro generates an error.

Arguments passed to CTOT() are unaffected by SET MARK TO. It is worth noting that, in spite of what the help file says, CTOT() doesn't care about current date delimiters specified by SET MARK TO or by the format of SET HOURS ( or by what's specified in the "International" page of the Options dialog), so CTOT("9/24/96"), CTOT("9-24-96") and CTOT("9.24.96") all work equally well, as does CTOT("9-24-96 11:00 pm") and CTOT("9.24.96 23:00")

Top | Home


DATASESSIONS

Private datasessions are endowed with VFP default values that have nothing to do with your Regional Window's settings.

Therefore for each new data session you must SET the appropriate values.

Some of VFP's SET commands, including most of those with international implications, are scoped to the current datasession.

Internationalization Gotcha: a problem arises when you create new Datasessions: the new Datasessions have VFP defaults, and these don't necessarily conform to the current SET settings or the current Windows international settings.

This means that whenever a new private datasession is created, you must ensure that its SET settings are correct for the current locale.

Here is a complete list of SET commands that are scoped to the datasession, with the ones in bold face indicating those that are locale-sensitive.

DataSession-Scoped SET commands

SET ANSI SET AUTOSAVE
SET BLOCKSIZE SET CARRY
SET CENTURY SET COLLATE
SET CONFIRM SET CURRENCY
SET DATABASE SET DATE
SET DECIMALS SET DELETED
SET DELIMITERS SET EXACT
SET EXCLUSIVE SET FIELDS
SET FIXED SET LOCK
SET MARK TO SET MEMOWIDTH
SET MULTILOCKS SET NEAR
SET NULL SET POINT
SET REPROCESS SET SAFETY
SET SEPARATOR SET SYSFORMATS
SET TALK SET UNIQUE

These SET commands are scoped to the datasession.

Top | Home


DATE()

DATE() returns the current system date.

Internationalization Gotcha: the date is formatted according to SET DATE, SET MARK, and SET CENTURY.

Top | Home


DATETIME()

DATETIME()returns the current date and time as a DateTime value.

Internationalization Gotcha: the format of the DateTime value returned by DATETIME( ) depends on the current settings of SET DATE, SET MARK, SET CENTURY, SET HOURS, and SET SECONDS. The format is also dependent on the settings in the International option in the Windows Control Panel.

Top | Home


DBGETPROP(cName, cType, cProperty)

DBGETPROP() returns a property for the current database, or fields, named connections, tables, or views in the current database.

Internationalization Gotcha: here are localizable elements for table fields:

CProperty Type Description
Caption C The field caption (read-write).
RuleText C The field rule error text (read-only).

 Here are localizable elements for views:

cProperty Type Description
Caption C The field caption (read-write).
RuleText C The field rule error text (read-write).

 Here are localizable elements for table properties:

cProperty Type Description
RuleText C The row rule error text (read-only).

 Here are localizable elements for views:

cProperty Type Description
RuleText C The rule text expression displayed when an error occurs when data is edited in a Browse or Edit window (read-write).

Top | Home


DEFINE BAR

DEFINE BAR creates a menu item on a menu created with DEFINE POPUP.

Internationalization Gotcha: this command is notable because, in my experience, it is often involved in "hard coded" and difficult to localize situations. DEFINE BAR has three internationally sensitive clauses: PROMPT (what the bar displays), FONT (which could vary with locale) and MESSAGE (the status bar message).

Top | Home


DEFINE MENU

DEFINE MENU creates a menu bar.

Internationalization Gotcha: menus are often involved in "hard coded" and difficult to localize situations. DEFINE MENU has two internationally sensitive clauses: the FONT (which could vary with locale) and MESSAGE (the status bar message).

Top | Home


DEFINE PAD

DEFINE PAD creates a menu title (pad) on a menu bar.

Internationalization Gotcha: menus are often involved in "hard coded" and difficult to localize situations. DEFINE MENU has two internationally sensitive clauses: the FONT (which could vary with locale) and MESSAGE (the status bar message).

Top | Home


DEFINE POPUP

DEFINE POPUP creates a menu.

Internationalization Gotcha: menus are often involved in "hard coded" and difficult to localize situations. DEFINE POPUP has several internationally sensitive clauses: the FONT (which could vary with locale); MESSAGE (the status bar message); FOOTER (the text at the bottom of the popup); PROMPT FIELD (which may bring in unlocalized text from a table); and TITLE (on the top border of the menu).

Top | Home


DEFINE WINDOW

DEFINE WINDOW creates and specifies the characteristics of a window.

Internationalization Gotcha: hard-coded window definitions are often the source of localization difficulties. The DEFINE WINDOW may have the following internationally sensitive clauses: the TITLE of the window; its FONT (which might need to vary with locale); and the ICON file (which may not be appropriate for all locales).

Top | Home


DefOLELCID Property

The DefOLELCID property applies to Form and _SCREEN objects, and specifies the default OLE Locale ID for a Form or the main VFP window.

Internationalization Gotcha: this default value determines the Locale ID for OLE Bound controls and OLE Container controls when they are placed on the form or the main VFP window.

If the default OLE Locale ID value for a Form or the main Visual FoxPro window is changed to a new value, then OLE Bound controls and OLE Container controls placed thereon afterwards use the new value.

If DefOLELCID is set to zero for a form or the main Visual FoxPro window, SYS(3004) determines the default Locale ID for OLE Bound controls and OLE Container controls placed on the Form or the main VFP window.

Here is a listing of Locale Ids:

Locale ID Language

1029

Czech

1031

German

1033

English (Default)

1034

Spanish

1036

French

1040

Italian

1045

Polish

1046

Portuguese (Brazilian)

2070

Portuguese (Standard)

Note: the DefOLELCID property only affects the language of the user interface, which OLE controls display, and not the language of the OLE automation commands. The OLE automation command language is affected only by the Global LocaleID, set with SYS(3005).

Top | Home


DMY(dExpression | tExpression)

DMY() returns a character expression in day-month-year sequence, for example "26 June 1996".

Internationalization Gotcha: DMY() comes from VFP, and the language varies with VFP's localized language. DMY()respects the setting of SET CENTURY.

Top | Home


DTOC(dExpression | tExpression [, 1])

DTOC() returns a Character-type Date from a Date or DateTime expression.

Internationalization Gotcha: the date format is determined by SET CENTURY and SET DATE and SET MARK.

Top | Home


DTOS(dExpression | tExpression)

DTOS() returns a character-string date in a yyyymmdd format from a specified Date or DateTime expression.

Internationalization Gotcha: this function is not affected by SET CENTURY.

Top | Home


DTOT(dDateExpression)

DTOT() returns a DateTime value from a Date expression.

Internationalization Gotcha: the format of the returned value depends on the current SET DATE and SET MARK settings.

Top | Home


EDIT

EDIT without NOMENU leads to an unlocalizable "Table" menu pad Internationalization Gotcha: when using EDIT without a NOMENU clause, VFP places a "Table" menu pad on the system menu containing a number of bars (with captions like "Properties", "Font", "Go to record", etc). The display language of this pad and its bars is a function of VFP's localization language. In international applications that use BROWSE, make sure you make it a EDIT...NOMENU and, if required, invoke your own supporting menu.

Top | Home


ERROR

The ERROR command generates a VFP error.

Internationalization Gotcha: if you issue an ERROR call with an error number, like this: ERROR 101, the message is in VFP's localized language. You can always issue ERROR 101, "My localized Error Message" to adorn errors with your own error message. In any event, the ERROR command is preempted by whatever action is specified by ON ERROR.

Top | Home


Error Messages

VFP error messages are in VFP's localized language. Internationalization Gotcha: error messages, which, in the absence of error handling adorn VFP's error dialog boxes and as available with MESSAGE() and AERROR(), are in the language of VFP's localization.

Top | Home


EXPORT TO ... AS nCodePage

EXPORT TO copies data from a VFP table to a file in a different format.

Internationalization Gotcha: AS nCodePage specifies the code page for the file EXPORT creates. VFP copies the contents of the currently selected table and, as it copies the data, automatically converts the data to the code page you specify for the new file. If possible, VFP marks the newly created file with the code page you specify.

If you omit AS nCodePage, no code page conversion occurs. If possible, VFP marks the newly created file with the code page of the table from which the data is copied. If nCodePage is 0, no code page conversion occurs and the new file is not marked with a code page.

Top | Home


FDATE(cFileName)

FDATE() is a low level file function that returns the last modification date for a file.

Internationalization Gotcha: the result is in a format determined by the current settings of SET DATE, SET MARK, and SET CENTURY.

Top | Home


FONTS

Internationalization Gotcha: depending on the localization, Fonts may be an issue. For example, the "Arial" font in the Cyrillic languages is called "Arial Cyr". Of course, in some Asian languages, there is no such thing as an Arial font.

Internationalization Tip: the best place to find locale-specific fonts is with the various localizations of Windows. If you are a member of the Microsoft Developer Network, then you may have several localized versions of Windows on CD-ROM. The advantage of using native fonts is your customers probably have them already installed, and it's one less thing to worry about.

Top | Home


Forms

Internationalization Gotcha: the form's Close box is localized in the language of VFP localization. This otherwise cannot be controlled.

Top | Home


GETCP([nCodePage] [, cDialogCaption] [, cDialogTitle])

GETCP() prompts for a code page by displaying the Code Page dialog box, and then returns the number of the code page chosen.

Internationalization Gotcha: other than the parameters you pass, you cannot control the language displayed in this dialog ” it comes from within VFP and you will need a localized version of VFP for this dialog to display properly in an alternate language.

Top | Home


GETDIR([cDirectory [, cDialogCaption]])

GETDIR() displays the Select Directory dialog box from which a directory or folder can be chosen.

Internationalization Gotcha: you cannot control the language displayed in this dialog ” it comes from within VFP and you will need a localized version of VFP for this dialog to display properly in an alternate language.

The line¦

?GETDIR("C:\", "cDialogCaption")

¦makes this rather unlocalizable dialog.

The GETDIR() dialog

Top | Home


GETEXPR TO ...

Internationalization Gotcha: the VFP expression builder comes from VFP and you cannot control its display language. To get a localized expression builder, you will need a localized version of VFP.

The GETEXPR TO dialog.

Top | Home


GETFILE([cFileExtensions] [, cDialogCaption] [, cOpenButtonCaption][, nButtonType] [, cCreatorType])

GETFILE() displays the Open dialog box and returns the name of the file you chose.

Internationalization Gotcha: other than the parameters you pass, you cannot control the language displayed in this dialog ” it comes from within VFP and you will need a localized version of VFP for this dialog to display properly in an alternate language.

The line¦

?GETFILE([cFileExtensions] ,[cDialogCaption], [cOpenButtonCaption],1)

¦produces this:

The GETFILE() dialog.

Top | Home


GETFONT()

GETFONT() displays the Font dialog box and returns the name of the font you choose.

Internationalization Gotcha: like many other such dialogs, this comes from VFP and the language of the dialog varies with VFP's localization.

The GETFONT() dialog.

Top | Home


GETPICT([cFileExt] [, cFileNameCaption] [, cOpenButtonCaption])

GETPICT() displays the Open dialog box and returns the name of the picture file you chose.

Internationalization Gotcha: other than the parameters you pass, you cannot control the language displayed in this dialog ” it comes from VFP and you will need a localized version of VFP for this dialog to display properly in an alternate language.

Top | Home


GETPRINTER()

GETPRINTER() displays the Windows Print Setup dialog box and returns the name of the printer you select.

Internationalization Gotcha: this dialog comes from the operating system and the display language varies with its localization.

The GETPRINTER() dialog.

Top | Home


HOUR(tExpression)

HOUR() returns the hour portion from a DateTime expression.

Internationalization Gotcha: HOUR( ) returns a numeric value based on a 24 hour format, and is not affected by the current setting of SET HOURS.

Top | Home


IDXCOLLATE([cCDXFileName,] nIndexNumber [, nWorkArea | cTableAlias])

IDXCOLLATE() returns the collation sequence for an index or index tag.

Internationalization Gotcha: IDXCOLLATE() can be used to return the collation sequence for each tag in multiple-entry compound index files, allowing you to completely delete an index file and rebuild it correctly, using a series of SET COLLATE and INDEX commands.

IDXCOLLATE() isn't required for the proper functioning of REINDEX, because the collation sequence information is present in existing indexes and index tags.

Top | Home


IMESTATUS([nExpression])

The Input Method Editor (IME) is a program that performs the conversion between keystrokes and ideographs or other characters, usually by user-guided dictionary lookup. IMESTATUS() turns the IME window on or off or returns the current IME status.

Return values for the IME status in the Japanese locale:

Return Value IME Status
4 Hiragana double-byte.
5 Katakana double-byte.
6 Katakana single-byte.
7 Alphanumeric double-byte.
8 Alphanumeric single-byte.

Return values for the IME status in the Korean locale:

Return Value IME Status
4 Hangeul mode.
5 Junja mode (double-byte).
6 Hanja conversion mode.

Top | Home


IMPORT FROM ... AS nCodePage

IMPORT FROM imports data from an external file format to create a new Visual FoxPro table.

Internationalization Gotcha: AS nCodePage specifies the code page of the imported file. Visual FoxPro copies the contents of the imported file and, as it copies the data, automatically converts the data to the current Visual FoxPro code page.

If you omit AS nCodePage and VFP cannot determine the code page of the imported file, VFP copies the contents of the imported file and, as it copies the data, automatically converts the data to the current Visual FoxPro code page. If you omit AS nCodePage and VFP can determine the code page of the imported file, VFP automatically converts the data in the imported file from the data's code page to the current VFP code page.

Top | Home


INDEX ON

Internationalization Gotcha: A problem occurs when the collating sequence for an index is set to something other than MACHINE. In that case, each character in the key uses two bytes. Since the maximum index key length is 240 characters, the longest key you can use is 120 characters for non-MACHINE collate sequences. This is true in 3.0 as well as 3.0b. The only way around this problem is to SET COLLATE TO MACHINE before creating that particular tag.

Top | Home


ISLEADBYTE(cExpression)

ISLEADBYTE() returns logical true if the first byte of the first character in a character expression is a lead byte. ISLEADBYTE() lets you determine if a character is a double-byte character. If the first byte of a character is a lead byte, the character is a double-byte character. Otherwise, the character is a single-byte character.

Top | Home


LEFTC(cExpression, nExpression)

LEFTC()from a character expression containing , which is similar to LEFT(), returns a specified number of characters any combination of single-byte and double-byte characters, starting with the leftmost character.

Top | Home


LENC()

LENC(), which is similar to LEN(), returns the number of characters in a character expression or memo field containing any combination of single-byte and double-byte characters.

Top | Home


LIKEC()

LIKEC(), which is similar to LIKE(), determines if a character expression matches another character expression. The character expressions can contain any combination of single-byte and double-byte characters.

Top | Home


LIST ...

Internationalization Gotcha: In the "old days" of FoxPro, the only way to get some sorts of information was to execute one of the LIST commands TO FILE and thereafter parse the resulting text. While I can't think of a reason to do this in VFP, some reason may occur. If it does, you should know that the LIST commands will produce output containing text that localized according to the language of VFP.

Top | Home


LOCFILE(cFileName [, cFileExt] [, cCaption] [, cCreatorType])

LOCFILE() locates a file on disk and returns the file name with its path.

Internationalization Gotcha: other than the dialog caption, you have no control over the captions in this dialog. LOCFILE() comes from VFP and its display language varies with VFP's localization language.

For example, the line¦

?LOCFILE("cFileName", "cFileExtensions", "cDialogCaption")

¦yields the following dialog under Windows NT 3.51. There are many interface strings on this dialog you can™t localize. You are at the mercy of the user™s VFP installation.

The LOCFILE() dialog.

MDY(dExpression | tExpression)

MDY() returns a character expression in month-day-year sequence, for example "June 26 1996".

Internationalization Gotcha: MDY() comes from VFP, and the language varies with VFP's localized language. MDY()respects the setting of SET CENTURY.

Top | Home


MESSAGE()

MESSAGE() returns the current error message as a character string.

Internationalization Gotcha: the error message is in the localized language of VFP. Note that AERROR(2)returns the same value as MESSAGE().

Top | Home


MESSAGEBOX(cMsgText [, nDialogType [, cTitleBarText]])

MESSAGEBOX() displays a user-defined dialog box.

You can™t directly localize the buttons in MESSAGEBOX().For example, the following line yields the box below wherein the "Yes" and "No" button captions cannot be touched.

?MESSAGEBOX("cMsgText" , 4, "cTitleBarText")

A MESSAGEBOX() dialog.

Top | Home


MODIFY COMMAND ... AS nCodePage

MODIFY COMMAND opens an editing window so you can modify or create a program file.

Internationalization Gotcha: AS nCodePage automatically converts accented characters in a program file created on another VFP platform. The numeric expression nCodePage specifies the code page of the VFP platform on which the program file was created. The file is saved in this code page unless you choose "Save As" from the File menu to save the file in a different code page.

Top | Home


MODIFY FILE ... AS nCodePage

MODIFY FILE opens an editing window so you can modify or create a text file.

Internationalization Gotcha: AS nCodePage automatically converts accented characters in a text file created on another VFP platform. The numeric expression nCodePage specifies the code page of the VFP platform on which the text file was created. The file is saved in this code page unless you choose "Save As" from the File menu to save the file in a different code page.

Top | Home


MODIFY QUERY ... AS nCodePage

Opens the Query Designer so you can modify or create a query. The Query Designer is a VFP dialog whose display language varies according to the localization of VFP.

Internationalization Gotcha: AS nCodePage specifies the code page of the query. Include AS nCodePage if the query was created with a code page other than the current VFP code page. When the query is opened, VFP automatically converts the query to the current VFP code page.

The query is saved in its original code page when it is closed.

If you omit the AS nCodePage clause or nCodePage is 0, the query is not converted to the current VFP code page.

In VFP, queries can be added to a project, and you can specify the query's code page from within the Project Container. The Project Container keeps track of the query's code page. However, if you use MODIFY QUERY to open a query outside of the Project Container, you should include AS nCodePage to specify the query's code page.

Top | Home


ODBC Errors

ODBC drivers generate ANSI SQL standard error codes, which are thereafter interpreted by VFP.

Internationalization Gotcha: the text of ODBC error messages come from VFP and will vary in language with the localized version of VFP.

Top | Home


OEMTOANSI(cExpression)

OEMTOANSI() converts each character of a character expression to the corresponding character in the ansi character set. Included for backward compatibility. OEMTOANSI() is used to move data from FoxPro for ms-dos to Visual FoxPro and FoxPro for Macintosh.

Top | Home


OLE Custom Controls

OLE Custom Controls come from a variety of sources and, for the most part, you'll get a mixed-bag of results when you use OLE controls in international settings. Be sure to inquire about supported locales before you commit to deploy a particular OLE control.

Top | Home


OLE ERRORS

Given that OLE controls come from many sources, it's not surprising to find that they don't all handle errors as you might hope. Some OLE controls return inte