Autor Beitrag
huuuuuh
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 665
Erhaltene Danke: 19

win xp, (win vista), win 7
VS 2008 Express Edition, VS 2010 Express Edition, VS 2010 Professionell
BeitragVerfasst: Fr 22.02.08 19:02 
ich hab eine liste und will nun etwas daraus in einer string-variable speichhern
(bekannter string)(unbekannter string)(bekannter string)
ich will nun den unbekannten string haben. geht das irgendwie?
Christian V.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 311

Win Xp Prof
Turbo Delphi 2005
BeitragVerfasst: Fr 22.02.08 19:05 
Vllt so?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var
Source, S1, S2, Unknown: String;
{...}
begin
{...}
Unknown := Copy(Source, Length(S1) + 1, Length(Source) - Length(S2));
{...}


S1 ist der erste bekannte String, S2 der zweite. Source steht für den Listeneintrag.

_________________
Hardware runs the world, software controls the hardware, code generates software - Have You already coded today?
huuuuuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 665
Erhaltene Danke: 19

win xp, (win vista), win 7
VS 2008 Express Edition, VS 2010 Express Edition, VS 2010 Professionell
BeitragVerfasst: Fr 22.02.08 20:25 
funktioniert leider nicht...
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 22.02.08 20:28 
user profile iconhuuuuuh hat folgendes geschrieben:
funktioniert leider nicht...


Geht nicht ist KEINE Fehlerbeschreibung!

So schwer ist es aber nicht, den Fehler zu finden.
Nutz halt den Debugger, oder lass dir den Ausgabestring anzeigen..
huuuuuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 665
Erhaltene Danke: 19

win xp, (win vista), win 7
VS 2008 Express Edition, VS 2010 Express Edition, VS 2010 Professionell
BeitragVerfasst: Fr 22.02.08 20:30 
delphi gibt keine fehlermeldung, aber der ausgebestring is leer
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 22.02.08 20:36 
Und was sind deine Eingabestrings?
huuuuuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 665
Erhaltene Danke: 19

win xp, (win vista), win 7
VS 2008 Express Edition, VS 2010 Express Edition, VS 2010 Professionell
BeitragVerfasst: Fr 22.02.08 21:33 
also ich hab nochma überlegt und hab die frage ein bisschen geändert jetzt passt sie besser
also ich hab einen string...und dieser hat zwei teile, die durch ein leerzeichen getrennt sind...ich will aber nur den teil ab dem leerzeichen haben.
Zorro
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76

Win 2000, Win XP Pro
Delphi 7 Architect
BeitragVerfasst: Fr 22.02.08 21:39 
user profile iconhuuuuuh hat folgendes geschrieben:
also ich hab nochma überlegt und hab die frage ein bisschen geändert jetzt passt sie besser
also ich hab einen string...und dieser hat zwei teile, die durch ein leerzeichen getrennt sind...ich will aber nur den teil ab dem leerzeichen haben.


Ah, das klingt verständlicher ;-)

Deine Freunde sind:
Funktion POS
Funktion COPY
Taste F1

Greetz
Zorro
iKilledKenny
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 8

Win XP
D5 Prof, C# Express 2005
BeitragVerfasst: Fr 22.02.08 21:43 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
function Split (AString  : String) : String;

var iPos : Integer;

begin
  iPos := Pos (#32, AString);
  if (iPos > 0then 
    Result := Copy (AString, iPos + 1, Length (AString)
  else
    Result := '';
end;
huuuuuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 665
Erhaltene Danke: 19

win xp, (win vista), win 7
VS 2008 Express Edition, VS 2010 Express Edition, VS 2010 Professionell
BeitragVerfasst: Fr 22.02.08 23:21 
danke dir...es funktioniert :D
hast in deinem code ne klammer vergessen :wink: