CodeSnip uses two config files – one system wide application file named Common.config and another user file named User.config. The standard version of CodeSnip maintains separate user config file for each user account that uses CodeSnip, while the portable version has just one such file.
Config files use the standard INI file format and are written and read using Windows API calls.
The following data types are supported:
False and True (although 0, No and N are all read as false).
YYYY-MM-DD hh:mm:ss format in all locales (i.e. the date and time separators are always - and : respectively.
From CodeSnip v4 config files are little endian Unicode text files with a byte order mark. This encoding is used because the international support is required and because the Windows API, which is used to read and write the files, understands this file format.
On earlier versions of CodeSnip the config files were ANSI text files using the system's default encoding. CodeSnip v4 and the standard edition's installer convert the older ANSI files to Unicode.
Note: From CodeSnip v4.16 this file is used only by the installer of the standard edition. The portable edition does not use the file and does not create it.
The file stores information about the current version of the program. It is named Common.config. The file is stored in the standard edition's %ProgramData%\DelphiDabbler\CodeSnip.4 directory.
There have been several versions of this file. The current one is version 7. The change to version 7 came with CodeSnip v4.16.0 and the removal of DelphiDabbler web service support.
The file has the following sections.
Provides information about the application.
Name / Value pairs:
Version (String)
Provides information about the config file itself.
Name / Value pairs:
Version (Integer)
1.
7.
This file records configuration information that is unique users of the application. Some sections correspond to user preferences while others record details of previous operations or the layout of the GUI. The file is named User.config. The standard edition of CodeSnip stores the file in the logged on user's %AppData%\DelphiDabbler\CodeSnip.4 directory, while the portable version stores it in the AppDir sub-directory of the folder where CodeSnip is installed.
There have been several versions of this file. The current one is version 19. The change to version 19 came with CodeSnip v4.21.0 and the addition of the [Compilers] section and the CanAutoInstall key in the [Cmp:XXX] sections.
The file has the following sections.
There is one of these sections for each compiler known to CodeSnip. Each section describes how CodeSnip should use the compiler, or indicates that the compiler is not available.
The actual name of a section is found by replacing XXX with one of the following values:
Name / Value pairs (same for all sections unless noted otherwise):
ExePath (String)
Displayable (Boolean)
Namespaces (String)
Prefix0 (String)
Fatal: .
Prefix1 (String)
Error: .
Prefix2 (String)
Warning: .
Switches (String)
SearchDirCount (Integer)
SearchDirXXX (String)
XXX ranges from 0 to SearchDirCount - 1.
CanAutoInstall (Boolean)
This section records configuration information that applies to all, or multiple, compilers.
Name / Value pairs:
PermitStartupDetection (Boolean)
This section records database customisations.
Name / Value pairs:
UserDataDir (String)
Persists the state of controls in the Duplicate Snippet dialogue box.
Name / Value pairs:
EditSnippetOnClose (Boolean)
Persists the state of controls in Favourites dialogue box.
Name / Value pairs:
DisplayInNewTabs (Boolean)
InactiveAlphaBlendValue (Integer)
128 to 255.
Provides information about the last compiler search that was run.
Name / Value pairs:
D2 (Boolean)
D3 (Boolean)
D4 (Boolean)
D5 (Boolean)
D6 (Boolean)
D7 (Boolean)
D2005w32 (Boolean)
D2006w32 (Boolean)
D2007 (Boolean)
D2009w32 (Boolean)
D2010 (Boolean)
DXE (Boolean)
DXE2 (Boolean)
DXE3 (Boolean)
DXE4 (Boolean)
DXE5 (Boolean)
DXE6 (Boolean)
DXE7 (Boolean)
DXE8 (Boolean)
D10S (Boolean)
D101B (Boolean)
D102T (Boolean)
D103R (Boolean)
D104S (Boolean)
D11A (Boolean)
D12Y (Boolean)
FPC (Boolean)
Option (Integer)
0 ⇒ snippet compiles OK; 1 ⇒ snippet compiles without warnings; 2 ⇒ snippet compiles with warning(s); 3 ⇒ snippet fails to compile; 4 ⇒ snippet not tested.
Logic (Integer)
0 ⇒ "and"; 1 ⇒ "or".
Provides information about last the last text search that was run and records a history of search terms.
Name / Value pairs:
HistoryCount (Integer)
HistoryXXX (String)
XXX ranges from 0 to HistoryCount - 1.
MatchCase (Boolean)
WholeWord (Boolean)
Logic (Integer)
0 ⇒ "and"; 1 ⇒ "or".
Provides information about the last snippet cross reference search that was run.
Name / Value pairs:
IncludeSnippet (Boolean)
Required (Boolean)
RequiredRecurse (Boolean)
Required = False.
RequiredReverse (Boolean)
SeeAlso (Boolean)
SeeAlsoRecurse (Boolean)
SeeAlso = False.
SeeAlsoReverse (Boolean)
Provides information about the config file and installed version of CodeSnip.
Name / Value pairs:
Version (Integer)
1.
19.
ProgramVersion (String)
Stores information about the Preferences dialogue box itself, rather than actual preferences data. Actual preference data is stored in sections with names like [Prefs:XXX] where XXX is a preferences sub-section.
Name / Value pairs:
LastTab (string)
Stores source code generation preferences. Used in test compilations or when generating user defined units.
Name / Value pairs:
EmitWarnings (Boolean)
True ⇒ emit directives; False ⇒ do not emit directives.
WarningCount (Integer)
WarningXXX.Symbol (String)
XXX ranges from 0 to WarningCount - 1.
WarningXXX.MinCompiler (Float)
XXX ranges from 0 to WarningCount - 1.
WarningXXX.State (Boolean)
XXX ranges from 0 to WarningCount - 1.
True ⇒ switch on; False ⇒ switch off.
Stores preferences for the main display.
Name / Value pairs:
OverviewStartState (Integer)
0 ⇒ fully expanded; 1 ⇒ fully collapsed.
ShowEmptySections (Boolean)
True ⇒ display empty sections; False ⇒ hide empty sections.
ShowNewSnippetsInNewTabs (Boolean)
True ⇒ a new tab is created for each new item; False ⇒ new items overwrite the current item in the selected tab.
MainDBHeadingColour (Integer)
UserDBHeadingColour (Integer)
SourceCodeBGColour (Integer)
MainDBHeadingCustomColourCount (Integer)
MainDBHeadingCustomColourXXX (String)
XXX ranges from 0 to MainDBHeadingCustomColourCount - 1.
ColourID=ColourNum where ColourID is a value from ColorA to ColorP and ColourNum is the hex representation of the colour.
UserDBHeadingCustomColourCount (Integer)
UserDBHeadingCustomColourXXX (String)
XXX ranges from 0 to UserDBHeadingCustomColourCount - 1.
ColourID=ColourNum where ColourID is a value from ColorA to ColorP and ColourNum is the hex representation of the colour.
SourceCodeBGCustomColourCount (Integer)
SourceCodeBGCustomColourXXX (String)
XXX ranges from 0 to SourceCodeBGCustomColourCount - 1.
ColourID=ColourNum where ColourID is a value from ColorA to ColorP and ColourNum is the hex representation of the colour.
OverviewFontSize (Integer)
DetailFontSize (Integer)
Stores miscellaneous application preferences.
Name / Value pairs:
Units (Integer)
0 ⇒ inches; 1 ⇒ millimeters.
Stores preferences that define the properties of one or more syntax highlighters. Also records information about the custom colours available when configuring the highlighters.
Name / Value pairs:
FontSize (Integer)
FontName (String)
ElemXXX.Color (Integer)
XXX ranges from 0 to 11.
ElemXXX.Style (Integer)
XXX ranges from 0 to 11.
NamedHiliterCount (Integer)
HilterNameXXX (String)
XXX ranges from 0 to NamedHiliterCount - 1.
NamedHiliterXXX entries below.)
NamedHiliterXXX.FontSize (Integer)
XXX ranges from 0 to NamedHiliterCount - 1.
NamedHiliterXXX.FontName (String)
XXX ranges from 0 to NamedHiliterCount - 1.
NamedHiliterXXX.ElemYYY.Color (Integer)
XXX represents the index of the corresponding syntax highlighter and ranges from 0 to NamedHiliterCount - 1. For each value of XXX there are 12 .ElemYYY values, with YYY ranging from 0 to 11.
NamedHiliterXXX.ElemYYY.Style (Integer)
XXX represents the index of the corresponding syntax highlighter and ranges from 0 to NamedHiliterCount - 1. For each value of XXX there are 12 .ElemYYY values, with YYY ranging from 0 to 11.
CustomColourCount (Integer)
CustomColourXXX (String)
XXX ranges from 0 to CustomColourCount - 1.
ColourID=ColourNum where ColourID is a value from ColorA to ColorP and ColourNum is the hex representation of the colour.
Stores default printing preferences.
Name / Value pairs:
UseColor (Boolean)
True ⇒ print in colour; False ⇒ print in black and white.
SyntaxPrint (Boolean)
True ⇒ use syntax highlighting; False ⇒ do not syntax highlight.
LeftMargin (Float)
TopMargin (Float)
RightMargin (Float)
BottomMargin (Float)
Stores preferences that describes the customisation of pages displayed in the details pane for different snippet kinds.
Name / Value pairs:
PageKindXXX (String)
XXX is the ordinal value of the snippet kind.
Description
SourceCode
Kind
Category
Units
Depends
XRefs
CompileResults
ExtraInfo
Stores preferences that specify how source code is exported by default.
Name / Value pairs:
FileType (Integer)
0 ⇒ plain text; 1 ⇒ Pascal; 2 ⇒ HTML; 3 ⇒ rich text (RTF).
CommentStyle (Integer)
0 ⇒ no documentation comment; 1 ⇒ a description of the snippet apperars between the snippet's prototype and the body of the code; 2 ⇒ the description of the snippet immediately precedes it.
TruncateComments (Boolean)
True ⇒ truncate the description; False ⇒ use the full description.
UseSyntaxHiliting (Boolean)
True ⇒ use syntax highlighting; False ⇒ do not syntax highlight.
Records the names of the units that appear in the Units check box list on the References tab of the Edit Snippet dialoogue box.
Name / Value pairs:
Count (Integer)
UnitXXX (String)
XXX range from 0 to Count - 1.
Note that some "reserved" unit names that always appear in the list box are not recorded in settings. They are:
If this section is missing or has no units listed then CodeSnip defaults to using the following units in addition to the "reserved" units:
These default unit names will be included in this section the first time it is written.
There is one of these section for each window that stores its state and size in the config file. XXX is a sub-section placeholder and is replaced by a unique name representing the window whose state is stored.
Some windows also store custom information in their sub-section that is unique to them. Values common to all sub-sections are described first, followed by additional details of any sub-section storing custom information.
These values do, or can, appear in any sub-section.
Name / Value pairs:
Left (Integer)
Top (Integer)
Width (Integer)
Height (Integer)
State (Integer)
0 ⇒ normal state; 1 ⇒ minimized; 2 ⇒ maximized.
These values are used only in the MainForm sub-section.
Name / Value pairs:
SplitterPos (Integer)
OverviewTab (Integer)