dos_getini - dalefugier/DOSLib GitHub Wiki

Returns a string from the specified section in the Windows-style initialization (.INI) file. The initialization file must have the following form:

[section]
entry=string
...

Syntax

(dos_getini section entry filename [default])

Parameters

section

The section containing the entry.

entry

The entry whose associated string is to be returned.

filename The filename of the initialization file.

default

A default return value. If entry is not found in the initialization file, default is returned.

Note, parameters are not case sensitive, so section and entry may be in any combination of uppercase and lowercase characters.

Returns

If section is nil, a list of section names is returned.

If entry is nil, a list of entries for the specified section is returned.

If entry is not found, default is returned.

Otherwise, a string associated with entry is returned.

nil on error.

Examples

Command: (dos_getini nil nil "C:\\Windows\\win.ini")
("AeDebug" "Clock" "Colors" "Compatibility" "Console" "Cursors" "DeskTop" "Devices" "Embedding" "Extensions" "Fonts" "FontSubstitutes" "GRE_Initialize" "Intl" "IOProcs" "MCI Extensions" "ModuleCompatibility" "MSCharMap" "Net_Files" "NWCS" "Ports" "PrinterPorts" "Sounds" "TrueType" "Twain" "Windows Help" "Winlogon" "Network" "Windows" "fonts" "extensions" "mci extensions" "files" "Mail" "MCI Extensions.BAK" "MSUCE" "SciCalc" "WS_FTP" "CKSN")
Command: (dos_getini "Mail" nil "C:\\Windows\\win.ini")
("MAPI" "CMC" "CMCDLLNAME" "CMCDLLNAME32" "MAPIX" "MAPIXVER" "OLEMessaging")
Command: (dos_getini "Mail" "CMCDLLNAME32" "C:\\Windows\\win.ini")
"mapi32.dll"