Thema: Delphi Problem mit Pos()

Einzelnen Beitrag anzeigen

sharkx

Registriert seit: 24. Feb 2003
Ort: St. Ingbert
211 Beiträge
 
Delphi 7 Enterprise
 
#12

Re: Problem mit Pos()

  Alt 16. Nov 2003, 22:51
hmm, eben doch nicht ...

ich geb mal nen paar Content Strings mit an und deren Ergebniss nach dem Parsen
Delphi-Quellcode:

sharkx: .help
        ^-------------------- Das ist der String Content, daraus wurde ...
Parse Commands:
Parse Text: .help

sharkx: .stats
Parse Commands:
Parse Text: .stats

sharkx: .add noob
Parse Commands: .add
Parse Text: noob
^---------------------------- So ist es richtig
Delphi-Quellcode:
  
  TextPos := Pos(' ', Content);
  Text := Trim(Copy(Content, CommandPos+1, length(Content)-CommandPos));

  CommandPos := Pos(' ', Content);
  Commands := Trim(Copy(Content, 1, CommandPos-1));


[EDIT]

*Kopfklatsch*
Das problem ist, ich weiß nichtmal ob ich überhaupt ein Leerzeichen übergeben bekomme! Also kann ich ja auch nicht immer danach suchen. Selbst dieser Punkt ist bicht immer da (.add). Also hab ich praktisch überhaupt keinen ansatz nachdem ich suchen könnte :/
Programming today is a race between Software Engineers striving to build bigger and better idiot-proof Programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning!
  Mit Zitat antworten Zitat