update file / inifile

Hello ! I need to read a ini file, from inside Navision, and update the file in some of the positions. But theres a problem, when I try to update the file in a specific positions. Are there an easy way to read and update ini files ? Best Regards Jan I hope someone can help me

You have two possibilities: 1) You might use a third party program, written in C, Delphi etc. I only have experience with Delphi which provides a TINIFile Class to help maintaining INI-Files. However this solution has a big drawback: You need to have this third-party progamm accessible from each client. 2) If you want to solve the whole problem within Navision, the only way is to read/scan/write the ini-file: Pseudocode: Var infile:file outfile:file Begin infile.textmode(true); outfile.textmode(true); infile.open(‘C:\Windows\source.INI’); outfile.create(C:\Windows\Target.ini’); While not ENdOfFile do begin infile.read(st); if () then st := outfile.write(st); End; Close(infile); close(outfile); file.erase(‘c:\windows\source.ini’); file.rename(‘c:\windows\target.ini’,‘c:\windows\source.ini’); END; Generally it is not recommended to use ini-files in a Windows 95/98/NT environment. Use the registry instead. Marcus Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch

Thanks for your answer. I had in mine it would be the only solution to the problem… Best regards jan