Autor Beitrag
rafi@work
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Fr 22.08.03 08:17 
Mein Ini sieht wie folgt aus

[ROUTE_POINT_ARRAY]
1=4566,4750,4750,4750,5


wie kann ich nun teile aus diesem Wert rauslesen und schreiben? zum beispiel die Zahl 5 oder 4750 oder 4566?

danke für eure hilfe!!

gruss
chris_davidi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76

Windows 98 SE
Delphi 3
BeitragVerfasst: Fr 22.08.03 08:28 
Gleiche Frage habe ich auch, wäre nett, wenn sich jemand damit beschäftigt. :)
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Fr 22.08.03 08:36 
Hallo!

In der FAQ gibt es einen Beitrag der zeigt wie man einen String zerteilt. Hier der Beitrag: ...einen unterteilten String in ein Array schreiben?

Gruß
Tino
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Fr 22.08.03 11:32 
kann mir jemand einige beispiele geben, wenn ich z.b. nur 4566 rauslesen und in einem textfeld anzeigen will, oder nur die zweite Ziffer.

bin für jede Hilfe sehr dankbar!

gruss
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Fr 22.08.03 12:27 
Luckie hat folgendes geschrieben:
Übergib den Wert an die Funktion EXPLODE. Oder genauer: www.delphi-forum.de/...ic.php?p=45780#45780 letzte Posting.

Ich habe dein 2tes Post aus der Datei-Sektion gelöscht und Luckies antwort von dort hier gepostet.
Bitte starte pro Frage nur EINEN Thread.

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Fr 22.08.03 12:49 
Danke Aya! Könnte mir niemand dafür ein Beispiel zeigen, ich komme damit leider nicht klar. Bitte!

gruss
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 22.08.03 13:12 
Du erstellst eien Variable vom Typ TStringDnyArray und dann übergibst du der Variable das Ergebnis von Explode, welche du mit deinem zu teiledem String und den Separator aufrufst und dann hast du deine Teilstring in einem StringArray stehen. Auf die einzelenen Teilstrings kannst du jetzt mit dem Index des Arrays zugreifen.
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Fr 22.08.03 13:16 
@ Luckie, danke für die Hinweise ! :) Werde es mal versuchen. Melde mich wieder...

greets
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Fr 22.08.03 13:33 
@ Luckie, könntest du mir nicht ein Beispiel geben.. Wäre die sehr dankbar.

gruss
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 22.08.03 13:39 
Später, muß zum Frisör.
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Fr 22.08.03 13:41 
danke dir schon zum voraus tausend mal!! bis dann.

greets
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Fr 22.08.03 13:49 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
Var
  StrArray: TStringDynArray;
Begin
  StrArray := Explode (',', '4566,4750,4750,4750,5');

  If Length (StrArray) > 0 Then
    Label1.Caption := StrArray [0];
End;
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Fr 22.08.03 14:00 
@ Tino danke, aber leider sind es nicht immer die gleichen Zahlen. wie würde es aussehen wenn die Zahlen unbekannt wären, man aber weiss das es 5 zahlen sind.

gruss
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Fr 22.08.03 15:18 
rafi@work hat folgendes geschrieben:
@ Tino danke, aber leider sind es nicht immer die gleichen Zahlen.

Das war/ist ja auch nur ein Beispiel. Statt den String fest im Quellcode anzugeben musst du halt diesen String vorher aus der Ini Datei lesen. Das sollte für dich doch kein Problem sein, oder? Versuch es einfach mal!

Gruß
Tino
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Fr 22.08.03 18:12 
nein das rauslesen von werten stellt kein Problem dar.

Explode ist doch eine Funktion :

www.delphi-forum.de/...ic.php?p=45780#45780

nur ist hier leider der code falsch..

gruss
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 22.08.03 23:30 
Was ist daran falsch? das wäre jetzt mal interessant. So ist deine Aussage wertlos. Desweiteren habe ich mit der Funktion schon öfters problemlos gearbeitet.
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Sa 23.08.03 12:54 
hmm ich probier nochmal, habe mich wahrscheinlich geirrt.

mfg
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Sa 23.08.03 13:38 
Und dann poste auch mal deine Lösungsansätz... damit wir dir besser helfen können.

Gruß
Tino
rafi@work Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 147

Win2000 Prof
D7 Enterprise
BeitragVerfasst: Mo 25.08.03 07:57 
ausblenden Delphi-Quelltext
1:
StrArray: TStringDynArray;					


wenn ich diese Variable deklariere, dann meldet es 'Undefinierter Bezeichner'. Was muss in der Uses-Klausel stehen?

gruss
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mo 25.08.03 09:09 
Wenn Du den Cursor auf TStringDynArray setzt und F1 drückst, dann weißt Du es.
Aber ich will mal nicht so sein: Es ist Types