Subject | Re: [firebird-support] Capture the output of GBAK console process and display on your GUI application |
---|---|
Author | Stefan Heymann |
Post date | 2007-12-11T11:36:39Z |
Salvatore,
face that problem. However, as you take care that only complete lines
of the returned console output get added to the TStrings list, it only
*looks like* everything is OK. It isn't.
When you replace this snippet of your code
repeat
I := Pos(#13#10, Line);
if I > 0 then
begin
List.Add(Copy(Line, 1, I - 1));
Delete(Line, 1, I + 1)
end
until I = 0
with this one:
List.Add (Line);
Line := '';
you will see what I mean. Of course there will now be wrong line
breaks in the output (you can correct that of course, but for the
shortness of this posting it's sufficient).
So, yes, it seems there should be some kind of flushing in the
Firebird console utilities.
Best Regards
Stefan Heymann
>> would you show us (or send me) the code that does it?Thanks for your code. On first sight, it looks like your code doesn't
> it's a pleasure. It consists of only one function and one procedure.
> The main function was borrowed from some Jedi code doing some
> modifications. It is not too long, so I post them into this message:
> [... Code snipped ...]
face that problem. However, as you take care that only complete lines
of the returned console output get added to the TStrings list, it only
*looks like* everything is OK. It isn't.
When you replace this snippet of your code
repeat
I := Pos(#13#10, Line);
if I > 0 then
begin
List.Add(Copy(Line, 1, I - 1));
Delete(Line, 1, I + 1)
end
until I = 0
with this one:
List.Add (Line);
Line := '';
you will see what I mean. Of course there will now be wrong line
breaks in the output (you can correct that of course, but for the
shortness of this posting it's sufficient).
So, yes, it seems there should be some kind of flushing in the
Firebird console utilities.
Best Regards
Stefan Heymann