Hello FPC-Pascal,

Thursday, March 31, 2011, 6:52:26 PM, you wrote:

B> This however means that the programmer has to protect TIniFile.Free
B> with a Try..Except block, which is also rather unusual.

It's unusual, but there is an error, or the class does not perform the
save in the free procedure and uses a "flush" (forced) or the class
must raise an exception as the expected job has not been performed.

procedure Example;
var
  INI: TIniFile;
  Earns: integer;
begin
  Earns:=5000;
  INI:=TIniFile.Create('bank-account');
  INI.CacheUpdates:=true;
  INI.WriteString('Money','earned',Earns);
  INI.Free;
  writeln('Great, this month $',Earns,' are in the pocket!');
end;

-- 
Best regards,
 José

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to