Autor Beitrag
Moonbiker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Mi 19.05.04 11:53 
Hallo,
habe einen String und möchte ihn von einer bestimmten Position bis zu einer Position auslesen.
weiterhin möchte ich wissen wie man die länge eines strings rausbekommt...

vielen dank
MartinPb
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 698



BeitragVerfasst: Mi 19.05.04 11:56 
s := Copy('Das ist ein Text', 2, 3);

i := Length(s);

_________________
Gruß
Martin
Moonbiker Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Do 20.05.04 15:54 
vielen dank, genau was ich suchte!!!

und das mit der länge, hatte length nur als lenght falsch geschrieben :roll:
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Sa 17.07.04 07:51 
Bei mir geht das irgendwie nicht. :?

ausblenden Delphi-Quelltext
1:
Label1.Caption := Length(Label1.Caption);					

Delphi hat folgendes geschrieben:
Inkompatible Typen: 'String' und 'Integer'
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Sa 17.07.04 08:03 
Coder hat folgendes geschrieben:
Bei mir geht das irgendwie nicht. :?


Aber nicht nur bei Dir. 8) Das geht so nirgendwo. Die Delphi-Fehlermeldung ist in diesem Fall wirklich eindeutig. Und dazu noch sehr vornehm. :lol:

_________________
Gruß
Hansa
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Sa 17.07.04 08:09 
Wie jetzt?
Funktioniert Length nur bei Integer/Zahlen?
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Sa 17.07.04 08:12 
nein, aber eine caption ist ein string, und du kannst keinem string eine zahl (die du von length erhälst) zuweisen. daher mußt du deine Zahl in einen string wandeln (inttostr)

ausblenden Delphi-Quelltext
1:
label1.caption:=inttostr(length(...));					


Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Sa 17.07.04 08:14 
Mal anders rum gefragt : "Wieviele Buchstaben bist du groß ?" :lol:

_________________
Gruß
Hansa
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Sa 17.07.04 08:14 
Oh, stimmt. :autsch: :autsch: :autsch: :autsch:

@hansa: Kommt drauf an. Bei welcher Schriftart und Schriftgröße denn? :roll:
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Sa 17.07.04 08:28 
Ich habe die Größe im Ascii-Zeichensatz gemeint. Oder wie wäre es mit Volt ? :rofl:

_________________
Gruß
Hansa
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Sa 17.07.04 08:43 
Volt? Kenn ich nicht...

Also bei Schriftart Arial und Schriftgröße 10pt bin Ich ca 178,57142857142857142857142857143 Buchstaben groß.
Der Zwischenraum zwischen zwei Zeilen wurde natürlich nicht vergessen. :wink:
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Sa 17.07.04 09:30 
[quote="Coder"]Volt? Kenn ich nicht...

[quote]

au weia.. tse tse. Dat ist dat zeuch, was aus de Steckdöse kömmt. Ick gloobe, dat steht im manual, page 44.

grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Di 23.11.04 16:19 
ausblenden Quelltext
1:
Label1.Caption := inttostr(Length(Label1.Caption));					


kommt da nich immer das gleiche raus (in einer Schleife), wenn die Länge von Label1
in label1 reinkommt, steht da zB. 12, beim nächsten mal steht da 2 und dann 1
und 1 bleibt dann.