The dBASE INI File Explained

Last Modified: January 23, 2004
Ken Mayer, Senior SQA Engineer
dBASE, Inc.


This article is an attempt at de-mystifying the entries in a standard dBASE .INI file. Some of the entries are only going to be seen in newer versions of dBASE (dB2K and dBASE Plus), and many of them have been around for awhile.

Some of this information is based on the Visual dBASE 5.x documentation (specifically the User's Guide), and the rest from examining a current .INI file and attempting to explain what it's all about.


What is an INI file, anyway?

The letters "INI" are short for "Initialization". An initialization file is used to contain information for an application, and is often (but not always) read at startup of the application.

When starting dBASE, a specific .INI file is used, and if it doesn't exist, it is re-created with a bunch of default settings. If the .INI file exists, but specific settings are not there, dBASE will re-create those settings.

The same thing happens for an application created by dBASE -- if a .INI file does not exist, it is created (or re-created), and even if it does exist if some settings are not there, they are created with default values.

What are the names of the .INI file?

For the most part, these are the names of the .EXE file. So, for dB2K, the .exe is named "dB2K.exe", and therefore the .ini file is named "dB2K.ini". For dBASE Plus, the .exe is named "Plus.exe", and so the .ini file is named "Plus.ini". For an application you created (a .exe used with the dBASE runtime), the name of the .ini should be the name of the executable (i.e., "MyApp.exe" would have "MyApp.ini").

Finally, a .INI file is simply a DOS Text file -- it can be opened in the Source Editor of dBASE, it can be opened with WordPad, Notepad, and any other application that can read text files. It can be manipulated in dBL either by using a file object, or by using a special custom class called INI.CC to manipulate it (found in the dBASE Users' Function Library - dUFLP for short).

Be careful when modifying the .INI file for dBASE Plus or dB2K -- if you change something you didn't mean to, you may get some odd results.

Note that as you make changes in the properties dialog, or in other parts of the IDE, that dBASE will be updating the .INI file -- this is so that it can remember the last place the inspector was in the designers, for example.


How Do I Find Things in My .INI File?

A .ini file is broken into two parts -- section headings, and name/value pairs.

A section heading is a title with square brackets around it. It might look like:

[CommandSettings]

The name/value pairs are specific things that the application looks for under a section heading by name, followed by an equal sign (=) and then by the value. Note that since this is a text file, all values appear as character strings, and if you use code to read these values, they will be returned as character strings (more on that later). A typical name/value pair might look like:

SEPARATOR=,

Note that the string is not in quotes -- this is not necessary, and can actually cause some difficulties.


Examining PLUS.INI

A good portion of the rest of this document will be exploring the various parts of the standard dBASE Plus .INI file ("Plus.ini"), and explaining the various sections.

As we examine these -- section-by-section -- a brief mention of items you may wish to include in your own application's .INI will be made ...

Install

The Install section is created when you install dBASE. It contains just some basic information that you fill in when you run the installer. Some of this information appears in the "Help | About dBASE" dialog ...

A typical "install" section looks like:

[Install]
Username=Ken Mayer
Company=dBASE, Inc.
CustomerNumber=000 000

For your own applications, you probably do not need this section, unless you intend to do something similar to what dBASE does (read this and use it for the Help | About dialog ...).

SourcePath

The SourcePath section is used by dBASE to define source aliases -- you can see these in the Properties dialog. If you want to you can change these, but it's not really a good idea to change the ones used specifically by dBASE itself -- you can modify your own, if you wish (see the dUFLP entry below, for example).

[SourcePath]
dBASEShared=C:\Program Files\dBASE\PLUS\Bin\dBLCore\Shared
dQuery=C:\Program Files\dBASE\PLUS\bin\dBLCore\dQuery
WebWizards=C:\Program Files\dBASE\PLUS\Web\Wizards
DOS5Conv=C:\Program Files\dBASE\PLUS\Converters\RunFrom32bit\DOS5FormConverter
Classes=C:\Program Files\dBASE\PLUS\dBLClasses
Images=C:\Program Files\dBASE\PLUS\Media\Images
Forms=C:\PROGRAM FILES\DBASE\PLUS\dBLClasses\Forms
FormControls=C:\PROGRAM FILES\DBASE\PLUS\dBLClasses\FormControls
Reports=C:\PROGRAM FILES\DBASE\PLUS\dBLClasses\Reports
ReportControls=C:\PROGRAM FILES\DBASE\PLUS\dBLClasses\ReportControls
Nonvisual=C:\PROGRAM FILES\DBASE\PLUS\dBLClasses\Nonvisual
Toolbars=C:\PROGRAM FILES\DBASE\PLUS\dBLClasses\Toolbars
CoreShared=C:\PROGRAM FILES\DBASE\PLUS\bin\dBLCore\Shared
Examples=C:\PROGRAM FILES\DBASE\PLUS\Samples\Examples
Output=C:\PROGRAM FILES\DBASE\PLUS\Output
ProjExp=C:\PROGRAM FILES\DBASE\PLUS\bin\dBLCore\ProjExp
Movies=C:\Program Files\dBASE\PLUS\Media\Movies
ResView=C:\Program Files\dBASE\PLUS\BIN\dBLCore\ResView
Samples=C:\PROGRAM FILES\DBASE\PLUS\Samples
dUFLP=C:\dUFLP

For your own applications, you do not need this section, as Source Aliases are not used in the Runtime environment, and this section will be ignored by your application.

Directories

The following is typical after you have used dBASE for awhile -- the directories section displays the most recently used directories, and has a specific name/value for the most recent or current directory. This is updated as you change the current folder in the Navigator window.

[Directories]
0=C:\Program Files\dBASE\PLUS\BIN
Current=3
1=C:\dUFLP
2=C:\dB2KTests
3=C:\GPFBugHunt

If you are deploying your own application, you should consider just removing this section. It will be re-created the first time the application is started. If you include this section with a path that doesn't exist on the users' machine, it can confuse the runtime engine and may cause problems.

CustomClasses

This section is used to load specific custom classes into memory with dBASE Plus loads. Note that as shown below this uses Source Aliases as defined in the earlier [SourcePath] section.

If you find that when you load dBASE it gives an error about a custom class that it cannot find, then this is where you can fix this problem. Simply find the entry for that file and delete it.

How do custom controls get added to this list? There are a couple of ways -- the first is to double-click on one in the dBASE Navigator. This automatically places it in the .ini file. The other is to use the File menu when in the form or report designer and select to save a custom control when done designing it, there is a checkbox in the save dialog to place it on the Component Palette. If you check this it will be placed in the .INI file in the list below.

[CustomClasses]
CC0=:FormControls:\DATABUTTONS.CC
CC1=:FormControls:\SEEKER.CC
CC2=:FormControls:\Splitter.cc
CC3=:ReportControls:\REPORT.CC

For your own application -- this is used for the design surfaces, and will not be useful for your .EXE -- it will be ignored as the design surfaces are not accessible from a dBASE runtime application.

Toolbars

The toolbars section is used to define information about specific toolbars used in the IDE (Integrated Development Environment), including whether they are available (turned on), 'float', etc.

In the case of many of these options, the choice is simply 1 or 0 -- 1 means "on", zero or 0 means "off". In some cases zero (0) means "use the default" and one (1) means do something other than the default.

Position entries: The entries that have four numbers with spaces between them are used to define the following -- position of the left side of the toolbar from the left of the screen, position of the top side of the toolbar from the top of the screen, position of the right side of the toolbar from the left side of the screen, and position of the bottom of the toolbar from the top of the screen. What this means is if you see the following:

StandardPosition=0 38 222 69

It means that the toolbar has the following coordinates:
Left: zero pixels from the left of the screen
Top: 38 pixels from the top of the screen
Right: the right side of the toolbar is 222 pixels from the left side of the screen
Bottom: the bottom side of the toolbar is 69 pixels from the top of the screen.

Note that if a position given is REALLY large (or has a negative value), you may find that this is the reason you cannot see something -- one way to reset this is to delete the entry from outside of dBASE (with dBASE not running), and then run dBASE again -- the entry will be re-created with a more rational setting.

The question than becomes what do each of these entries stand for? In many cases this is pretty straightforward, but I will attempt to explain in greater detail:

[Toolbars]
Standard=1
StandardFloat=0
StandardStyle=0
StandardPosition=0 38 222 69

The standard toolbar is the one that is normally docked at the top of the screen in the IDE. The first entry means that it is on -- in other words, when you start dBASE it appears.

StandardFloat references whether or not it is a floating toolbar -- in other words, is it docked or not? If it is floating it appears as a palette or window. This defaults to zero (0) or "off", meaning it is NOT a floating toolbar.

StandardStyle ...?

StandardPosition -- see the discussion on "Position entries" above.

The rest of these entries should start to make sense if you examine them.

FormatPosition=864 408 1007 575
FormDesignerComponentPosition=8 56 354 283
Alignment=1
Format=0
AlignmentFloat=0
AlignmentStyle=0
AlignmentPosition=475 38 721 69
FormatFloat=1
FormatStyle=0
FormDesignerComponentFloat=0
FormDesignerComponentStyle=0
FormDesignerComponent=1
FormDesignerFieldPosition=8 339 208 681
FormDesignerFieldFloat=0
FormDesignerFieldStyle=0
CurrentTab=2
ReportDesignerComponentPosition=8 8 208 235
ReportDesignerComponentFloat=0
ReportDesignerComponentStyle=0
ReportDesignerComponent=1
FormDesignerField=1
ReportDesignerField=1
DataModDesignerComponent=1
LargeButtons=0
ShowTooltips=1
FlatButtons=1
ComponentDrawMode=0
ComponentShowTabs=1
ComponentRevertToPointer=1
ComponentDockable=0
FieldDrawMode=3
FieldShowTabs=1
FieldRevertToPointer=1
FieldDockable=0
FieldBuddyTextControlType=2
ReportDesignerFieldPosition=8 339 208 681
ReportDesignerFieldFloat=0
ReportDesignerFieldStyle=0

Inspector

The inspector section includes items specific to the Inspector window. Again, most of these should make sense if you examine them.

[Inspector]
Position=670 157 1004 439
CenterLine=170
Float=0
Style=0
ExpandedCategories=172031
Visible=1
CurrentTab=0
CategoryView=1
Dockable=0
AlwaysOnTopAdjust=0
AlwaysOnTop=0

Most of these make sense if you look at them, the following have a bit more explanation:

Centerline is the line that separates the names of the properties, events and methods, and the right side of the inspector where you can modify these values. This is the position from the left of the inspector in pixels.

ExpandedCategories ???

Visible - is pretty understandable ... if it's '1' it is on screen, if it's '0' it is not.

CurrentTab - this is the current tab in the Inspector - 0, 1 or 2 (Properties, Events or Methods).

CategoryView - is either '1' or '0' - on or off -- category view shows the properties in category listings, if it is off, it just shows all properties alphabetically.

AlwaysOnTopAdjust ???

FormDesigner

The form designer section gives some specific details on how the form designer opens, and so on.

[FormDesigner]
MethodEditor=0
BaseFormClassFileName=
BaseFormClassName=
SnapTo=0
GridOneCharacter=0
ShowGrid=1
GridPixelUnits=7 11
LastCC=C:\GPFBugHunt\GridTest.cc

MethodEditor is either 1 or 0, if it is 1 it means that when the form designer opens, the MethodEditor window opens with it. If it is 0 the form designer does not open the MethodEditor window.

BaseFormClassFileName is used to specify the name of the current (if any) custom form class file -- the file that contains the definition of the custom form. This is set when the designer is open, using the File menu, and "Set Custom Form Class ...". The dialog that appears allows you to set a class that will be used until you clear it (and you can clear it from the same dialog).

BaseFormClassName is the name of the actual custom form -- a custom form file can contain more than one form ...

SnapTo is either 1 or 0, it refers to the "Snap To Grid" setting, which can be changed by right clicking on the form designer and selecting the "Form Designer Properties" menu option.

GridOneCharacter ???

ShowGrid is either 1 or 0, and it tells the designer whether to show the grid (as dots) on the form designer surface.

GridPixelUnits these two numbers are the values shown in the Form Designer Properties dialog for the X and Y settings.

LastCC is the last Custom Control loaded when using the form designer.

Desktop

The desktop settings are modified from the Desktop Properties dialog box accessed from most of the menus in dBASE.

A few settings below are not changed in that dialog, but most are. The ones that are modified in the Properties dialog have names that should make sense, and most of the values are 1 or 0 (on or off).

[Desktop]
Maximized=1
Position=51 77 972 691
StatusBar=1
CurrentTab=6
SplashScreen=1
DQueryStart=0
FormWizard=0
ReportWizard=0
DataModuleWizard=0
TableWizard=0
ShowBackupFiles=0
ViewerSizeToFit=1
LogFileOverwrite=1
Sessions=0
LabelWizard=0
FieldsLayoutStyleSQL=1
FieldsLayoutStyleTable=1

Maximized is whether or not the IDE itself is maximized.

StatusBar is whether not the status bar appears at the bottom of the screen.

CurrentTab is the current tab of the Desktop Properties dialog ...

CommandWindow

This specifies whether the Command Window itself is open when you start dBASE, maximized, minimized, and so on.

[CommandWindow]
Open=1
Maximized=0
Minimized=0
Position=0 310 765 679
PaneRatio=46
PanePosition=0

PaneRatio -- the splitter between the Command Window and the Output Pane, this is the distance from the top (or left) of the Command Window.

PanePosition is either 0 (horizontal) or 1 (vertical) -- meaning that the if it is zero, the Command Window is on top, and the Output Pane is on the bottom; if it is 1, the Command Window is on the left, and the Output Pane is on the right ...

Navigator

This is pretty straightforward based on previous entries.

[Navigator]
Open=1
Maximized=0
Minimized=0
Position=0 8 807 310
CurrentTab=5

Database

This is the last database alias that was open the last time you close dBASE, and a couple of other entries that can be modified from the Desktop Properties dialog.

[Database]
Name=
RememberLogin=1
SqlTrace=0

RecentFiles

This is the "Most Recently Used" (MRU) list. You can change the list size if you wish, and these are the files most recently examined, worked with, etc. The number following the files ... (?)

[RecentFiles]
ListSize=5
0=C:\VdB7x Bugs\change.wfm,4
1=C:\HowToGrid\SaveGrid.DBF,4
2=C:\program files\dBASE\PLUS\Samples\Contax\sched.dmd,3
3=C:\GPFBugHunt\fish2.dbf,4
4=C:\GPFBugHunt\test.dbf,4

RecentProjects

Just like it sounds, if there were any projects in this list below it would look very similar to the above list for RecentFiles ...

[RecentProjects]
ListSize=5

CommandSettings

Many or most of these can be gotten to and changed or modified from either the Desktop Properties dialog, or from commands in dBASE (SET or SET TO commands -- check online help).

[CommandSettings]
LDRIVER=Windows
EDITOR=
PATH=
ALTERNATE=
SEPARATOR=,
POINT=.
CURRENCY=$
DATE=MDY
MARK=/
REFRESH=0
REPROCESS=0
DBTYPE=DBASE
IBLOCK=1
MBLOCK=8
TYPEAHEAD=49
BELL=512,50
EPOCH=1950
DECIMALS=2
PRECISION=10
MARGIN=0
Language=EN

When preparing an application for deployment, you should check to see if these commands are ones you need to have in the .INI file for your application. If these are not in the .INI file the user may get defaults that don't match, many of these mismatches are the cause of differences that developers experience between their application running in the IDE and a separate executable on a user's machine.

ImageViewer

These are settings for the image viewer. These can be changed in the Desktop Properties dialog, on the Application tab ("Viewers" section).

[ImageViewer]
PlayForever=1
Position=24 24 136 84

PlayForever is an on/off setting (1/0) and has to do with animated images -- if it is set to 1, it will loop back to the beginning of the animated image.

SizeToFit is the "Size window to content" option, this defaults to 1, and isn't in the .ini file by default -- it should only be here if you change the default.

OleViewer

[OLEViewer]
StoreAsOLE2=1

StoreAsOLE2 -- If checked the value is 1 (checked in the Desktop Properties dialog) OLE 1.0 objects in legacy code will not work. Check this option only if you do not have to support the older version of OLE.

OnOffCommandSettings

Nearly all of these, if not all, can be modified through SET commands (i.e., "set century on" and/or they can be modified through the Desktop Properties dialog. Check the online help for details about these specific entries (SET CURRENCY, for example).

[OnOffCommandSettings]
CURRENCY=LEFT
CENTURY=ON
LDCHECK=OFF
LOCK=ON
EXCLUSIVE=OFF
AUTONULLFIELDS=ON
AUTOSAVE=OFF
DELETED=ON
EXACT=OFF
NEAR=OFF
ENCRYPTION=ON
CONFIRM=ON
CUAENTER=ON
ESCAPE=ON
BELL=ON
FULLPATH=OFF
SPACE=ON
COVERAGE=OFF
DEVELOPMENT=ON
DESIGN=ON
SAFETY=ON
TALK=OFF
TITLE=OFF
HEADINGS=ON

When preparing an application for deployment, you should check to see if these commands are ones you need to have in the .INI file for your application. If these are not in the .INI file the user may get defaults that don't match, many of these mismatches are the cause of differences that developers experience between their application running in the IDE and a separate executable on a user's machine.

ErrorHandling

New to dB2K release 0.4, the errorHandling options given match up with the options in the Desktop Properties dialog, and with the _app properties of the same name. Check online help for details on how these work.

[ErrorHandling]
ErrorAction=4
ErrorLogFile=PLUSErr.log
ErrorLogMaxSize=100
ErrorHtmFile=error.htm

You may want to use these for your own applications -- particularly the options for Web Applications (check the OLH -- the ability to create your own error page is really pretty amazing).

BriefEditor

These options all affect the Source Editor (Method Editor) and in some cases affect the Command Window as well.

[BriefEditor]
SliderPosition=151
ExpandedTrees=5
EditorTab=1
ColorSpeedSetting=0
EditSpeedSetting=0
TabbedWindow=1
TreeViewGraphics=1
TabSize=3
UndoLimit=32767
MouseDelay=0
AutoColors=1
AutoIndent=1
BkspOutdents=0
BriefCursors=0
CursorBeyondEOF=1
CursorThruTabs=1
GroupUndo=1
IndentSize=3
OptimalFill=0
OverWriteBlocks=1
PersistentBlocks=0
RightMargin=80
SmartTabs=0
UndoAfterSave=0
UseTabChar=1

None of these options are useful for a deployed application, as your user will not have access to the Source Editor.

Editor

I believe this is the position of the editor used when modifying a memo in the IDE -- if you double-click on a table and work from the grid view, and double-click on the memo field, this editor is what appears.

[Editor]
Position=50 159 995 616

Not very useful for a deployed application, if you allow your user to use this, they can move it where they will, so setting a specific position is not something that makes much sense.

MethodEditor

This is the editor used in the form designer, report designer, etc. to modify/edit your source code.

[MethodEditor]
Position=367 367 1014 667

Not very useful for a deployed application.

TextEditor

This is the location of the Source Editor when it is invoked by typing MODIFY COMMAND <filename> in the Command Window, or opening an existing text file.

[TextEditor]
ViewerPosition=35 66 253 313

ReportDesigner

Most of these are options that can be modified by right-clicking on the design surface in the report designer and selecting "Report Designer Properties ...".

[ReportDesigner]
SliderPosition=0
Position=146 8 859 668
ShowGrid=1
SnapTo=1
ShowRuler=1
ShowStreamFrame=1
ShowOnlyOneRow=0
AllControls=1
ShowShading=1
BaseReportClassFileName=
BaseReportClassName=
LastCC=C:\GPFBugHunt\Test.cc

BaseReportClassFileName and BaseReportClassName are similar to the similar name/value pairs for the ReportDesigner section, as is the LastCC option.

As with the form designer, these options are not needed for a deployed application as your user will never see the report designer.

Project

Used by the Project Manager, this only shows on option at the moment, perhaps others when a real project is created.

[Project]
RootLocation=C:\GPFBugHunt\
PropertiesCurrentTab=2

Again, your user is never going to see the Project Manager, so this is not useful in your own application's .INI.

ProjectExtensions

I have NO idea what the numbers mean here.

[ProjectExtensions]
wfm=0
rep=1
lab=1
bmp=0
gif=0
jpg=0
jpeg=0
jpe=0
xbm=0
tif=0
tiff=0
wmf=0
emf=0
pcx=0
eps=0
png=0
ico=0
dbf=0
db=0
sql=3
cfm=0
mnu=0
pop=0
crp=0
dmd=0
cdm=0
cc=0
prg=0
h=0
txt=0
cpp=0
c=0
hpp=0
java=0
prj=0
jbr=0

ProjectExplorer

Items relating to position and such for the Project Explorer. (Note: this is the older Project Manager or Project Explorer used in versions of dBASE prior to dBASE Plus release 2.2. The new Project Explorer that is pure dBL code uses its own .ini file ...)

[ProjectExplorer]
SliderPosition=240
IconType=1
Position=66 66 866 525

The Project Explorer is really a design surface for projects, and again the properties of this are not going to be useful in a deployed application as the user won't have access to it.

ReportViewer

This is the internal report viewer that is displayed when you run a report in the IDE, or in the runtime environment. Since this can be moved by the user, it's only purpose is to show the last position it was at when a report was viewed using it.

[ReportViewer]
Position=0 0 713 660

Dialogs

These are all positions from the last time these dialogs were used. These dialogs are only useful in the IDE ...

[Dialogs]
FindText=150 201 524 335
More=207 196 387 310
ReplaceText=173 178 544 364
ComponentOrder=343 221 682 548

Components

ActiveX file registration values, these are used to make these available in the form and/or report designer.

[Components]
0=1
1={20DD1B9E-87C4-11D1-8BE3-0000F8754DA1}
2={8E27C92B-1264-101C-8A2F-040224009C02}
3={06A7EC63-4E21-11D0-A112-00A0C90543AA}
4={6D940285-9F11-11CE-83FD-02608C3EC08A}
5={58DA8D8A-9D6A-101B-AFC0-4210102A8DA7}
6={3D6D5D2F-B9F2-101C-AED5-00608CF525A5}

You may need to leave these out, as registering ActiveX controls may provide a different value for a different computer (?).

CustomColors

These are custom colors as defined by the getColor() dialog.

[CustomColors]
Colors=16777215,16777215,16777215,16777215,16777215,16777215,...

I'm not real sure how useful these might be in a deployed application.

ProjectCustomFolders

This is filled in when you add a custom folder to a project. (Right click on the treeview side of the Project Manager, choose "New Folder"). Custom folders are not stored in the project itself, just in the application's .INI file. These entries are not used by any part of the software other than the Project Manager, and are not necessary to worry about for deployment. The default entry is:

[ProjectCustomFolders]
Count=0

If you have added any custom folders then you might see:

[ProjectCustomFolders]
Count=1
1=Batch Files,BAT

MenuDesigner

The position of the menu design surface, not sure what else might appear here.

[MenuDesigner]
Position=371 0 651 264

As with other designer entries, this is not too likely to be useful in a deployed application.

ComponentTypes

These options can be gotten to in several places when working in the IDE, including from the Desktop Properties dialog (Table tab, "Associate Component Types" button), to specify what the default component types are for specific field types.

[ComponentTypes]
ComponentTypeNumeric=1
ComponentTypeDate=1
ComponentTypeLogical=0
ComponentTypeMemo=0
ComponentTypeBinary=0
ComponentTypeOLE=0

For a deployed object it may be useful to include this section from your own application -- in some cases, specifically grids, if you have modified these settings, you may see incorrect settings on your forms.

In addition to those above, with some changes in dBASE Plus release 2.2 in the grid, when 2.21 came out a new option was added that can be manually placed in the .ini file. By default the grid now uses a special columnEditor control for memo fields. If you would prefer older behavior (the entryfield with an icon) for memo fields in a grid, then add the following to your Plus.ini (and/or your application's .ini file). Note that this also affects the grid as used with the BROWSE command from the Command Window, or double-clicking on a table in the Navigator.:

[Grid]
DefaultMemoEditor=1

The value zero (0) in place of the '1' in the above line will tell dBASE to use the default behavior (use a columnEditor for memo fields).


Custom BDE .CFG File?

When deploying an application that uses a custom .CFG file, you need a special set of entries:

[IDAPI]
CONFIGFILE01=mycustom.cfg

The name of the .cfg file, as well as the path, if it is not in the folder of the application should be included.


Encrypted Tables

If you are working with encrypted tables (using the dBASE PROTECT command to do so), you will need to deploy the DBSYSTEM.DB file, but you also need to have an entry in your .INI that looks like:

[CommandSettings]
DBSYSTEM=D:\PATH

Where "D:\PATH" is the path to the directory where you are deploying this file to. If you already have a "[CommandSettings]" section (see above), just add the "DBSYSTEM" entry. If you are deploying the DBSYSTEM file to the same as your application you can set this to "." (i.e., DBSYSTEM=. ) -- the "." stands for "current directory" ...


Items You Can Add

You can add some settings to the .ini file that may not be there to start with. These include things like a "Default Fonts" group:

[Default Fonts]
Application=FontName,Size Controls=FontName,Size

Note that you need to do this with the name of a font and with the fontsize, so you could do something like:

[Default Fonts]
Application=Arial,10 Controls=Times New Roman,12


Reading/Modifying a .INI File In An Application

If you do not create a .INI file for your application, the first time you start a .exe, it will create a .INI file with the following information (note, the .INI will have the same name as the .EXE, so if your executable's name was MYAPP.EXE, the .INI would be named MYAPP.INI):

[Toolbars]
Standard=1
StandardFloat=0
StandardStyle=0
StandardPosition=-2 38 37 69

[CommandWindow]
Open=1
Maximized=0
Minimized=1

[Directories]
0=C:\GPFBugHunt
Current=0

[Database]
Name=

If you wish to, you can use the .INI file for your own purposes. You can use code calling the Windows API if you wish (that's a bit tricky for a lot of programmers), you can use the File class in dBASE, or you can use an existing custom class that is in the freeware library of code called the dUFLP (dBASE Users' Function Library Project) called INI.CC. This class allows you to read entries, modify them, delete them, and a lot more. It's worth checking out, rather than writing your own code to do what is already written.

What kinds of things would you want to code into a .INI file?

Dynamic External Objects (DEO)

If you are using DEO for your application, you may wish to place your object files (.PRO, .WFO, etc.) into specific folders. This is discussed elsewhere, but for a deployed application you need special entries in the application's .INI file. You need an entry for each folder you are using, but note that there is an upper limit to the number of folders that can be recognized by DEO.

[ObjectPath]
objPath0=c:\mainlib

This would be the first folder that your application looks in to find an external object, and so on. You can have a total of 10 folders, and the name on the left of the equal sign must always be "objPath" followed by a number from 0 to 9, the value on the right of the equal sign must always be a valid path (although dBASE won't return an error if it is not valid).



DISCLAIMER: the author is an employee of dBASE, Inc., but has written this on his own time. If you have questions regarding this .HOW document, or about dBASE you can communicate directly with the author and dBVIPS in the appropriate newsgroups on the internet.

.HOW files are created as a free service by members of dBVIPS and dBASE, Inc. employees to help users learn to use dBASE more effectively. They are edited by both dBVIPS members and dBASE, Inc. Technical Support (to ensure quality). This .HOW file MAY NOT BE POSTED ELSEWHERE without the explicit permission of the author, who retains all rights to the document.

Copyright 2002-2004, Kenneth J. Mayer. All rights reserved.

Information about dBASE, Inc. can be found at:

http://www.dbase.com


EoHT: dBASEIniFile.htm -- January 23, 2004 -- KJM