: :
This message was edited by porodoro at 2005-12-31 7:18:25
: :
This message was edited by porodoro at 2005-12-31 7:17:48
: :
This message was edited by porodoro at 2005-12-31 7:16:54
: : I've tryed this :
: :
: : VAR I:INTEGER;
: : VAR F:TEXTFILE;
: : begin
: : AssignFile(F, 'C:\STATE.TXT');
: : Reset(F);
: : for i := 0 to ComponentCount-1 do
: : begin
: :
: :
if (Components[i]) = (TEdit) then
: :
: : with TEdit(Components[i]) do
: : begin
: : // X
: : writeln(f, inttostr(TEdit(Components[i]).Left));
: : // Y
: : writeln(f, inttostr(TEdit(Components[i]).Left));
: : // WIDTH
: : writeln(f, inttostr(TEdit(Components[i]).WIDTH));
: : // HEIGHT
: : writeln(f, inttostr(TEdit(Components[i]).HEIGHT));
: : //text
: : writeln(f, TEdit(Components[i]).text);
: : end;
: : END;
: :
: : Compiler's return error at the
highlighted line/
: :
: : error :
: :
: : [i] [Error] Unit1.pas(38): Incompatible types [/i]
: :
: :
: :
: : And one more thing. How to restore the position ?
: :
: :
: :
: Sorry, I made a small mistake the bold line should be:
:
: if Components[i] is TEdit then
:
: Similar with the other if-then.
: The IntToStr()'s in the writeln()'s are not necessary, because Writeln() can take any number of nearly any variable type as parameters. Also you need to use Rewrite() instead of Reset() when writing textfiles.
: Reading and restoring the position is done using the Readln().
:
I think i will use ini's for mass restore.
Anyway , thanks !.