Installing/Configuring FoxPro 2.6 for Macintosh
by Dennis Allen
Installing and configuring FoxPro for the Macintosh is a little different
than a Windows system. This tip sheet was created to cover the some of the
basics.
FYI: If this sheet doesn't answer your question, check other web sites, such as Universal Thread
or Visual
FoxPro Wikis. You could
also post your problem
to the Microsoft
FoxPro forum or the google newsgroup microsoft.public.fox.programmer.exchange.
All information contained on this sheet is provided as is. There are no warranties, expressed or implied. The author and contributors may not be held liable for any damages, including any lost profits or other incidental or consequential damages arising out of or inability to use this information. Use of this information constitutes acceptance of this disclaimer. You should always double check any information before acting upon it.
This sheet contains references and/or links to other sites or to third party suppliers of goods and/or services. Such references or links should not be considered as an endorsement by the sponsors of this web site.
Compiled FoxPro 2.6a for Windows *.APP and *.FXP files will run on FoxPro 2.6a for Macintosh. You may, however, have to adjust your code to handle the Mac. The following describes some of these changes:
@ FILL TO
Simply put, the @ FILL TO option doesn't work right on the Macintosh. Code around it. Example:
IF .NOT. _MAC
@ WROWS()-3,0 FILL TO WROWS()-1,WCOLS()-1 COLOR SCHEME nSCHEME2
ENDIF
BROWSE
In FoxPro for Macintosh, the browse command might lose focus. A problem if you use popups. Two solutions. 1) After every window release, DEACTIVATE browse window. 2) Replace any dialog message window with WAIT "message" WINDOW NOWAIT.
BUILD EXE
Building an executable on the Macintosh is fine, just don't execute it. Let me explain.
The Macintosh operating system associates each application, and files created with that application, with a unique creator code and file type. When you use FoxPro to create an executable file, your executable file shares the same creator code and file type as FoxPro. If you run that FoxPro executable file, then try to launch any FoxPro file (like config.fpm), your executable will run instead.
As an application developer, you can work around this situation. You can, for example, find a utility to alter the creator code of your executable.
If you already ran the executable, you can repair the creator codes. Remove or stuff/zip your application executable. Once removed, press [Cmd]-[Opt]-{Esc] ([Cmd] is the cloverleaf button). This will force quit the Macintosh finder. On finder restart, pressing [Cmd]-[Opt] will allow you to rebuild your desktop database. That should repair the problem.
GETENV()
Is this the biggest problem on the Macintosh. Unlike other OS platforms, the Macintosh does not have environment variables. GETENV() always returns an empty string.
To avoid the problem, I converted all my GETENV() calls to fnGETENV(). This function opens the file FOXPRO.INI, located in your foxuser.dbf directory. It finds environment variables defined in the [GetEnv] section of FOXPRO.INI. You can find a copy of this function on my web site.
ON KEY LABEL ALT
ON KEY LABEL ALT works fine on the Mac. Just remember that [Alt] is the same as [Ctrl]-[Opt]. Adjust your messages: "Press [Alt]-[P] to continue", for example, needs to read "Press [Ctrl]-[Opt]-[P] to continue".
PARAMETERS
When you build an executable, remember that you can never pass it any parameters via PARAMETERS command. See GETENV().
SET LIBRARY TO FOXTOOLS
When I try to SET LIBRRARY TO FOXTOOLS, I get the message "ASLM error: Install from the 'Apple Shared Library Manager' disk shipped with FoxPro".
Since my FOXTOOLS.MLB does reside in the systems extension folder, my system must not have this shared manager installed. Of the 18 diskettes that come with FoxPro 2.6a for Macintosh, I do not know which one is the Apple Shared library manager. If someone does, please let me know.
SET PRINT
Using an undocumented SET PRINT option, you can set the printer's font, pitch, and style. For example:
SET PRINT FONT "FoxFont", 7 STYLE "N"
FYI: GETFONT() produces [FoxFont,7,N]. To be suitable for SET PRINT FONT you would have to add quotes and replace the second comma with STYLE.
SET SCOREBOARD OFF
If you SET SCOREBOARD ON, an input error might prompt with (Press SPACEBAR to continue). On some systems, you may not be able to read this message.
On my Macintosh, SET SCOREBOARD ON also hides the last line of the main window. To avoid these problems, I've added a new feature to my applications. User can now define an environment variable STATUS=OFF, which does a SET SCOREBOARD OFF.
SET SYSMENU OFF
The Macintosh doesn't exclude access to the system menu very well. To turn off the system menu, you might have to add the following code:
*save sysmenu
SET SYSMENU OFF
IF _MAC
PUSH MENU _MSYSMENU
SET SYSMENU TO _MFILE
ENDIF
*restore sysmenu
IF _MAC
POP MENU _MSYSMENU
ENDIF
ZOOM WINDOW
When starting your application, the Macintosh can be fussy about the main window dimensions. To avoid problems, simply add a ZOOM WINDOW SCREEN MAX to your startup code.
SYS(1037, '')
The FoxPro for Macintosh 'Page Setup' dialog box doesn't allow you to change printers. It only allows you to configure the current printer. To change printers go to the Apple Menu->Chooser dialog box.
SYS(2027, '')
FoxPro, in general, wants to work with file paths using MS-DOS conventions. Certain instances, however, require Macintosh naming conventions. Use SYS(2027, '') to convert a MS-DOS path to a Macintosh path.
I've just heard from the google newsgroup microsoft.public.fox.programmer.exchange about people having problems running FoxPro on OS9/G4 machines. One person solved their problem by changing the color depth from "millions" to "thousands".
Another option is running System 8.6 on the G4. You can get a "special" version of 8.6 from Apple dealers to use on the G4 and the iMac.
Could be that your Power Mac runtime doesn't like OS9. Switching to the foxmac26.esl, the regular runtime, might solve your problem. If any of these solutions work, please let me know.
Here are a couple of CONFIG.FPM commands you may need to add to your Macintosh system:
CATMAN = "OFF"
With my development system, CATMAN = ON produces the following error:
"Catalog manager cannot run because it requires FOXTOOLS.MLB in the system extensions"
The catalog manager needs foxtools.mlb, which cannot be installed without the Apple Shared Library Manager. So just keep CATMAN = OFF.
COMMAND = "DO mal.fxp"
Launching either the file config.fpm or the fox*.esl runtime will execute all commands in config.fpm. Since you cannot pass parameters to a Macintosh executable, add COMMAND to launch your application.
MACDESKTOP = "OFF"
With MACDESKTOP = OFF, Windows cannot be moved off the main FoxPro Window.
VOLUME C = C-120:
If you created the directory c-120:dmail4, this volume command will result in FULLPATH('') = "C:\DMAIL4".
Couple of notes: You must add the suffix ":" to your volume drive. If your volume directory contains spaces, you also need to enclose it with quotes. Example: VOLUME C = "c-120:mailing list:".
People always ask me where to purchase a copy of FoxPro for Macintosh. You
might try either ebay.com or amazon.com.
Keep checking the ebay stores. Copies float on and off that site all the time. Also try one of the
following:
EMS Professional Software
Retro Tools CC Systems, a Florida consulting firm: (727) 596-1460. FoxPro for Unix.
In the event you can't find a development copy, don't despair. A FoxPro 2.6
for DOS/Windows compiled FXP or APP file will work just fine in FoxPro 2.6 for
DOS, FoxPro 2.6 for Windows, FoxPro 2.6 for Macintosh, or FoxPro 2.6 for Unix.
All you need is a runtime.
An example of a runtime can be found in the freeware
section of this web site.
I hope you have found this tip sheet useful. If you have a tip to add, drop me an email (
[Return to Top]
[Go to Home Page]
Copyright © 2013 Dennis Allen.
This web page was last updated 11/25/15