Forum > FPC development
TiniFile alters inifile comments
howardpc:
--- Quote from: klyxmaster on August 17, 2014, 02:06:22 pm ---anyone have a trick to prevent the "=#" scenario?
--- End quote ---
I have no trick, but you can alter the behaviour to what you want by changing the IsComment function of the Inifiles unit. Unfortunately it is a stand-alone function, not a virtual method of TIniFile which could be overridden without needing to tinker with the source. Simply change it to the following:
--- Code: ---
function IsComment(const AString: string): boolean;
const
Comments: set of Char =[';','#'];
var
c: char;
begin
Result := False;
if (AString > '') then
Result:=(AString[1] in Comments);
end;
--- End code ---
Rather than alter the sources, I would just copy the source to your project directory, renaming to something other than inifile, and put the altered file in your uses clause, rather than inifile.
Navigation
[0] Message Index
[*] Previous page