(this test was made on Lazarus 0.9.16 on windows)
---------------------------------------------------------------------------------------------

In a new project, new form, with a tmemo and a tbutton, put the following code:

implemetation
uses LCLProc;

procedure Tform1.button1Click(Sender: TObject);
var i,n: integer;
begin
  n:= getenvironmentvariablecount;
  memo1.lines.add('envcount='+inttostr(n));
  for i:=1 to n do
    memo1.lines.add(inttostr(i)+' - '+GetEnvironmentString(i));
end;

this only works the first time the program is executed in Lazarus IDE.

If you run another time in the IDE it doesn't works (value of n is 0, GetEnvironmentString() returns empty strings). This can be avoided if you reset the debugger with the command Run/Reset Debugger, each time the program is executed in the IDE.

this happens only if the program uses LCLProc,
maye some problems in the finalization part of this unit?


bye
tiziano


_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to