Autor Beitrag
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 03.08.02 10:59 
Hallo !!!
Ich möchte mir eine Art Befehlszeilen interpreter bauen. Dazu gibt der User die Befehle in ein MomoFeld ein. Die einzelnen Befehle frage ich mit einer Case Schleife ab. Aber wie kann ich immer die nächste Zeile des Memos in einen String bekommen ???

_________________
In the beginning was the word.
And the word was content-type: text/plain.
cbs
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 207
Erhaltene Danke: 1



BeitragVerfasst: Sa 03.08.02 11:37 
Tag auch

die zeilen des memos stehen in der eigenschaft lines vom typ TStrings
ausblenden Quelltext
1:
befehl:= Memo1.Lines[2];					

hier wird die zeile 3 in die variable befehl (string) eingelesen. es ist deshalb die zeile 3 weil die erste zeile des objects lines (TStrings) den index 0 hat
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
var 
  cnt: Integer;
  befehl: string;
begin
  for cnt:= 0 to memo1.Lines.Count - 1 do begin
    befehl:= memo1.lines[cnt];
    if befehl = 'exit' then Form1.Close;
    {...}
    // sonstige befehlsabfragen
  end;
end;

ich hoffe das wars was du meintest
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 03.08.02 12:58 
jo das isses !!!! Du bist super !!!!!

_________________
In the beginning was the word.
And the word was content-type: text/plain.
scape
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 41



BeitragVerfasst: Di 06.08.02 22:13 
Gehört zwar nicht hier hin, aber dein MomoFeld verschreibsel ist schon nice ;)
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 07.08.02 08:33 
Aber dafür hab ich ja meine Signatur !!!

_________________
In the beginning was the word.
And the word was content-type: text/plain.