Autor Beitrag
stigge
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Do 01.03.07 15:19 
Wie kann ich herausfinden, wie lang ein String ist :?:
basti_1984
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 104

Linux, Win Xp, Win 2000
Delphi, C, C++, PHP,
BeitragVerfasst: Do 01.03.07 15:23 
mit string.length()

_________________
Wissen ist Macht. Nichts zu Wissen macht auch nichts
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Do 01.03.07 15:26 
die Konstruktion ist mir nicht ganz klar...
HelgeLange
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 735
Erhaltene Danke: 6

Windows 7
Delphi7 - Delphi XE
BeitragVerfasst: Do 01.03.07 15:27 
schau mal in der delphi-hilfe unter "Length" nach...

_________________
"Ich bin bekannt für meine Ironie. Aber auf den Gedanken, im Hafen von New York eine Freiheitsstatue zu errichten, wäre selbst ich nicht gekommen." - George Bernhard Shaw
Leuchtturm
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Do 01.03.07 15:28 
ausblenden Delphi-Quelltext
1:
2:
3:
var s: string
...
label1.caption := inttostr(s.length)

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Do 01.03.07 15:30 
[Fehler] Unit2.pas(47): E2018 Record, Objekt oder Klassentyp erforderlich
[Fehler] Unit2.pas(48): E2014 Anweisung erforderlich, aber Ausdruck vom Typ 'Length' gefunden

Das Wort lenght scheint er grundsätzlich nicht zu mögen^^
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: Do 01.03.07 15:32 
Moin,

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var s: String;
begin
 s := 'Irgendwas';
 Label1.Caption := IntToStr(Length(s));
end;


Saubäär
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Do 01.03.07 15:38 
user profile iconSaubäär hat folgendes geschrieben:
Moin,

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var s: String;
begin
 s := 'Irgendwas';
 Label1.Caption := IntToStr(Length(s));
end;


Saubäär


Das hätte früher kommen müssen, so funktioniert's nämlich^^.
ausblenden Delphi-Quelltext
1:
i := Length (s);					

Danke an euch alle!
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 01.03.07 16:14 
user profile iconbasti_1984 hat folgendes geschrieben:
mit string.length()
Davon hab ich persönlich allerdings echt noch nie was gehört ... :shock:

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: Do 01.03.07 16:19 
user profile iconJayEff hat folgendes geschrieben:
user profile iconbasti_1984 hat folgendes geschrieben:
mit string.length()
Davon hab ich persönlich allerdings echt noch nie was gehört ... :shock:

Ich schon ... in C++ :lol:
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 01.03.07 16:19 
Zitat:
mit string.length()
Davon hab ich persönlich allerdings echt noch nie was gehört ... :shock:

Da in Delphi für Windows ein String keine Klasse ist geht sowoas nicht. Unter Java/.Net mit Stringklassen schon.

_________________
Markus Kinzler.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Do 01.03.07 18:46 
In Javascript macht man das auch so:
ausblenden Quelltext
1:
2:
var str = 'Hallo Welt!';
document.write(str.length);

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
HelgeLange
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 735
Erhaltene Danke: 6

Windows 7
Delphi7 - Delphi XE
BeitragVerfasst: Do 01.03.07 18:51 
und weil das ein Delphi-Forum ist, bringt man Antworten, die auf in C oder Java funktionieren, aber in Delphi nicht ? Sehr hilfreich, Leute.

Vielleicht einfach vor dem Schalter "Reply" immer mal eben schauen, in welchem Forum ihr gerade schreibt ;)

Hinweis für die, die es brauchen : Oben links in der Titelbar steht das...

_________________
"Ich bin bekannt für meine Ironie. Aber auf den Gedanken, im Hafen von New York eine Freiheitsstatue zu errichten, wäre selbst ich nicht gekommen." - George Bernhard Shaw