Einzelnen Beitrag anzeigen

hboy

Registriert seit: 16. Jan 2004
364 Beiträge
 
#13

Re: eigene Konsole -> writeln output ?

  Alt 4. Jan 2005, 00:04
sorry. Also es geht darum dass ein Fehler bei Readln auftritt. Ich weiß nicht wie ich ein Lesen realisieren soll. Testweise könnte man auch 'Test' in den Buffer schreiben.
Ich weiß allerdings nicht wo das Programm mit dem Fehler abbricht. Kleine Änderung:

Delphi-Quellcode:
Function ConsoleIn(var F: TTextRec): Integer;
begin
  // ???
  Result := 0;
end;

Function ConsoleOut(var F: TTextRec): Integer;
begin
  if not killed then ConsoleWin.proto.AddLine(F.Buffer,BackgroundColor,TextColor);
  FillChar(F.Buffer,F.BufPos-1,0);
  F.BufPos := 0;
  Result := 0;
end;

Function ConsoleIgnore(var F: TTextRec): Integer;
begin
  Result := 0;
end;


Function DevOpen(var F: TTextRec): Integer;
begin
  with F do begin
    BufPos := 0;
    BufEnd := 0;
    case Mode of
      fmInput: begin
        InOutFunc := @ConsoleIn;
        FlushFunc := @ConsoleIgnore;
      end;
      fmOutput: begin
        InOutFunc := @ConsoleOut;
        FlushFunc := @ConsoleOut;
      end;
      fmInOut: begin
        Mode := fmOutput;
        InOutFunc := @ConsoleOut;
        FlushFunc := @ConsoleOut;
      end;
    else
      Result := 1;
      Exit;
    end;
  end;
  Result := 0;
end;
Power is nothing without TControl
  Mit Zitat antworten Zitat