Autor Beitrag
rizor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 209

WIN XP
Delphi 2005 PE, Visual C++
BeitragVerfasst: Do 05.10.06 17:42 
Hallo,

kann man den Delimiter auf "0" setzen?
Also dass er ein Edit trennt auch wenn kein Abstand dazwischen ist?

Wenn ich xy.Delimiter:='' eingebe, bekomme ich einen Fehler.

Geht das überhaupt?

Danke im voraus.
cuejo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 142

Win XP
Delphi 7 Personal und 2005 PE
BeitragVerfasst: Do 05.10.06 17:53 
Also ich kenne mich damit zwar nicht aus, aber im ASCII-Code ist #0 ein leerer Charakter(NULL).

_________________
Computer sind dumm, aber fleißig. Deshalb arbeite ich so gerne damit.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 05.10.06 18:02 
Und nach welchem Kriterium soll er dann Trennen?
Zitat:
Also ich kenne mich damit zwar nicht aus, aber im ASCII-Code ist #0 ein leerer Charakter(NULL).
Ist imho EOS (End-Of-String)

_________________
Markus Kinzler.
rizor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 209

WIN XP
Delphi 2005 PE, Visual C++
BeitragVerfasst: Do 05.10.06 18:20 
Er soll die Teile einfach trennen.
Also es sind zum Beispiel AB dann soll er A und B trenne.
Dazwischen soll kein leerzeichen oder sonst was sein.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 05.10.06 18:33 
Willst du den Inhalt buchstabenweise oder in der Mitte trennen?

_________________
Markus Kinzler.
rizor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 209

WIN XP
Delphi 2005 PE, Visual C++
BeitragVerfasst: Do 05.10.06 18:34 
Was meinst du mit in der Mitte trennen?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 05.10.06 18:36 
Zitat:
Was meinst du mit in der Mitte trennen?
ABBA -> AB, BA oder buchstabenweise A,B,B,A

_________________
Markus Kinzler.
rizor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 209

WIN XP
Delphi 2005 PE, Visual C++
BeitragVerfasst: Do 05.10.06 18:37 
Nee, er soll es in a,b,b,a aufspalten.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 05.10.06 18:40 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
for i := 1 to Length( Edit.Test) do
begin
  sl.add( String(Edit.Text[i]));
end;

_________________
Markus Kinzler.
rizor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 209

WIN XP
Delphi 2005 PE, Visual C++
BeitragVerfasst: Do 05.10.06 18:44 
danke.
rizor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 209

WIN XP
Delphi 2005 PE, Visual C++
BeitragVerfasst: Fr 06.10.06 13:27 
GIbt es eine Möglichkeit den Delimiter "variabel" zu machen?
Ich möchte, dass der der Delimiter zwischen + und - entscheidet und danach dann die und dann das Edit teilen.
Also im edit steht zum Beispiel 4x^2+8x-3
dann soll er 4x^2 8x und -3 speichern.
Damit ich dann weiter rechnen kann.

Ist sowas möglich?
Ich hatte die Idee, dass ich erst ein Delimiter mit + mache ud dann einen mit -
Geht das auch einfacher?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 06.10.06 13:30 
Über den Delimiter geht das nicht. Du müßtest dir also eine eigene Routine schreiben, die dir die Strings zerlegt.

_________________
Markus Kinzler.
rizor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 209

WIN XP
Delphi 2005 PE, Visual C++
BeitragVerfasst: Fr 06.10.06 13:37 
Meinst du eine Routine, die entscheidet ob es ein + oder - ist?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 06.10.06 13:38 
Nein, eine Funktion die dir deinen Ausdruck in seine Atome zerlegt.
BTW. Es gibt schon fertige Matheparser.

_________________
Markus Kinzler.
Xion
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
EE-Maler
Beiträge: 1952
Erhaltene Danke: 128

Windows XP
Delphi (2005, SmartInspect), SQL, Lua, Java (Eclipse), C++ (Visual Studio 2010, Qt Creator), Python (Blender), Prolog (SWIProlog), Haskell (ghci)
BeitragVerfasst: Fr 06.10.06 13:47 
ausblenden function SplitTerm(Term: String): TStringList;
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
function SplitTerm(Term: String): TSringList;
var A,Last: integer;
begin
 Result:=TSringList.Create(Application);

 Last:=0;
 for A:=1 to Length(Term) do
  if (Term[A]='+')or(Term[A]='-')or(A=Length(Term)) then
   begin
    Result.Add(Copy(Term,Last,A-1)); 
    Last:=A; 
   end;

end;


müsste so funktionieren, ob das mit der TSringList so funktioniert weiß ich nich, aber ansonsten müsste es gehen (ersetze notfalls Result durch ein Memo auf deiner Form und lösch zeile 4)

_________________
a broken heart is like a broken window - it'll never heal
In einem gut regierten Land ist Armut eine Schande, in einem schlecht regierten Reichtum. (Konfuzius)