Why lazarus convert the encoding of files in mode graphical? lazarus / 13-General ---------------------------------------------------------------------- dicas3d · 2010-07-02 16:56 I use Lazarus 0.9.28.2 and I have a problem. I write a file with my program writed in Lazarus. This file is of type RECORD. And when i try read the file in the same program it don't read appropriately. It shows squares but not the correct data. In the write moment i have this code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i dir := c + '\carros.sgs';delete(dir,0,4);carrosarray[i+1].nome := InputBox('Criar carro','Introduza o nome do carro','');system.Assign(carrosfile, dir);system.ReWrite(carrosfile);For contador := 1 to i + 1 do begin   Write(carrosfile, carrosarray[contador]);End;system.Close(carrosfile); At the read moment i have this code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  dir := c + '\carros.sgs'; system.assign(carrosfile,dir); system.ReSet(carrosfile) ; i := 1; contador := 1; while not eof(carrosfile) do begin       system.Seek(carrosfile, contador-1);       Read(carrosfile, carrosarray[contador]);       i := i + 1;       contador:=contador+1; end; system.Close(carrosfile); ---------------------------------------------------------------------- typo · 2010-07-02 17:10 Try this: Code: [Select]Write(carrosfile, carrosarray[contador][1]); ---------------------------------------------------------------------- dicas3d · 2010-07-05 08:00 Don't work. ---------------------------------------------------------------------- dicas3d · 2010-07-05 10:40 I can solute it. The trick is remove the "{$H+}" from the top of the unit that have the RECORD's. To avoid problems the RECORD's must has be on a separated unit. ---------------------------------------------------------------------- vvzh · 2010-07-05 12:51 You can try to use "string[255]" instead of plain "string" in record fields and keep {$H+} directive. This way there is no need in separate unit. ---------------------------------------------------------------------- Marc · 2010-07-07 09:11 Better not to fiddle with directives if you need shortstrings in a record. as vvzh said you can use sting[nn] for a fixed length string or just ShortString (which is a string[255]) Same if you need ansistrings, just use AnsiString instead of string.