![]() |
Re: Problem mit Pos()
@Minz
Aus der OH: Zitat:
|
Re: Problem mit Pos()
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 :/ |
Re: Problem mit Pos()
Zitat:
Zitat:
|
Re: Problem mit Pos()
Also nach diesem Aufbau?
Name: .Commands Text Name: Commands Text Name:.Commands Text Name:Commands Text Name: .Commands Name: Commands Name:.Commands Name:Commands |
Re: Problem mit Pos()
Dann musst du halt If verwenden:
Delphi-Quellcode:
If (Pos(' ', Content) > 0) then
begin // Normaler Code end else begin Command := Content; Text := ''; end; |
Re: Problem mit Pos()
endlich .. schwere geburt .. vielen dank :)
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:16 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz