Microsoft KB Archive/90413

= Microsoft Knowledge Base =

Creating Applications for Both the Macintosh and the PC
Last reviewed: February 16, 1996

Article ID: Q90413

The information in this article applies to:


 * Microsoft FoxBASE+ for the Macintosh, version 2.01

SUMMARY
To develop a database application that is compatible with both the FoxPro for MS-DOS and FoxBASE+/Mac platforms, develop the application in the Macintosh environment and then convert it to MS-DOS.

NOTE: As an alternative, upgrade the FoxBASE+/Mac program to FoxPro for Macintosh. FoxPro provides a common code base that allows screens, reports, menus, and code to be transported between platforms.

MORE INFORMATION
During the process of developing in the Macintosh environment, do not use any Macintosh-specific options such as placing a control at a pixel location rather than at a row and column location. Other commands that are not supported in the MS-DOS environment are some GET and SAY options, the SCREEN command, ON MENU, and ALERTs. Fonts, styles, and colors are not supported by MS-DOS format files.

It is easier to export from FoxBASE+/Mac to FoxPro 2.0 for MS-DOS because FoxBASE+/Mac does not have a Menu Builder, Screen Builder, or RQBE facility. FoxPro is more powerful than FoxBASE+/Mac and it sets new standards for cross-platform language compatibility and functionality.

The amount of work required to perform the conversion depends on how &quot;Mac like&quot; the application is. If an application does not use Macintosh-specific features such as the PIXEL command, option buttons, picture data types, and some menu commands, copy the .PRG, .DBF, and .IDX files from the Macintosh to the PC and run the program. Fix the errors found in the compilation process and others as they become evident. Although FoxPro does not directly support many of the interface elements seen on the Macintosh, a FoxView template, called &quot;Code In A Flash,&quot; provides many of these interface elements in FoxPro.

NOTE: Observe MS-DOS file-naming conventions because they are more restrictive than the Macintosh conventions.

The text below lists four potential pitfalls in cross-platform development:


 * While the Macintosh uses colons to separate directory levels, MS-DOS uses backslash (\) characters. To address this, use the SET VOLUME command in FoxBASE+/Mac or place the SET VOLUME command in the CONFIG.FX file.
 * The Macintosh uses a page-oriented printing approach rather than the line-oriented approach in PC-compatible computers. For this reason, the SET PRINT OFF command causes two page eject operations on a Macintosh, only one on a PC.
 * When platform-specific code is required, use the VERSION function to determine the platform on which FoxBASE+ is running. Creating specific procedures for the version-specific code makes the code more readable and maintainable.
 * Some FoxBASE+ for MS-DOS functions and commands (such as GETENV and RUN) have no corresponding equivalents on the Macintosh and vice versa. The FoxBASE+/Mac &quot;User's Guide&quot; lists the PC commands that do not apply to the Macintosh. In many cases, you must code the application to the lowest common denominator.