FoxPro
Sample Code
The following are sample FoxPro procedures derived from my applications. Please feel free to use them. There are, however, no warranties expressed or implied. Enjoy!
fnGETENV v01.00.00
fnGETENV.PRG is a function similar to GETENV(), but retrieves environment variables from
the [GetEnv] section of your FOXPRO.INI file.
fnPRINT_RAW v01.00.00
If you tried to print raw output from FoxPro 2.6a for Windows on a Windows XP, you probably experienced a
"General Protection Fault". fnPRINT_RAW.PRG is a workaround to this bug. I haven't tested this code on many machines, so it might
or might not work in your situation.
Thanks to Andrew Howell of microsoft.public.fox.programmer.exchange for helping me tackle this problem.
To operate this function, you'll need to download the following:
DOT v01.00.07
DOT.PRG is a very simple program. Simulates the FoxPro command window (dot prompt). If all
you have is a FoxPro runtime, at least this module will let you execute basic FoxPro
commands. To exit DOT, type QUIT [Enter].
FOXRW v01.00.03
FOXRW.PRG is a very simple program, allowing you to create a FoxPro runtime. For more
information about creating your own runtime, see the FoxPro information
sheet.
GENERIC v01.01.01
GENERIC.PRG will take a *.PRN file (created from Word 95/97 'Generic/Text Only' to file
output), and convert it to an ASCII *.MAN file. This MAN file will have proper carriage
return/linefeeds and 60 lines/page, suitable for either display or print.
MKDIR v01.01.00
MKDIR.PRG creates multi-level directories via the RUN command.
Note: This procedure is not FoxPro for Macintosh compatible.
PRINTME v01.00.00
PRINTME.EXE is a small Visual FoxPro 6.0 compiled EXE. Copy this file to your
C:\WINDOWS\SENDTO folder. When you right-click on a PRN file, you can sendto the file to
printme.exe which will prompt you for the desired printer. The file is then copied
directly to the printer, 1000 bytes at a time.
Note: This executable requires either Visual FoxPro 6.0 or the Visual FoxPro 6.0 runtime already installed.
I recently enhanced PRINTME.EXE, replacing the GETPRINTER() prompt with a Visual FoxPro top level form. To this form I added a "number of copies" option.
SAVE_MEM v01.00.00
SAVE_MEM.PRG will save memory variables, with different prefixes, to the same memory file.
THERM v01.00.00
THERM.PRG is a simple thermometer. Up to 4 levels. Odometer aware. Derived from my
thermometer procedure, minus window/font handling code.
Y1900 v01.00.01
Y1900.PRG is a simple Y2K program. It will check all the DBF files in the current
directory. Any date field, in the specified date range, will be incremented 1200 months.
01/01/1900, for example, will be incremented to 01/01/2000. Note that Y1900.PRG won't
touch dates stored in character fields (C(8)). Also remember to backup your data files
before using such a program.
Copyright © 2005 Dennis Allen. My email address is: dennis
dennisallen.com.
This web page was last updated 04/03/08