Autor Beitrag
moloch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Di 24.08.04 13:58 
Hallo,
was kann ich tun wenn ich einen String einer Variablen zuweisen will der länger ist als 255 Zeichen?

mfg
moloch
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Di 24.08.04 14:02 
Du darfst ihn nur nicht als ShortString deklarieren, oder die Standard-Compilerdirektive dazu umbiegen.

_________________
Gruß
Hansa
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Di 24.08.04 14:04 
normal geht ein string bis zu 2GigaByte. kurze strings($H-) gehen nur bis 255 zeichen.

_________________
si tacuisses, philosophus mansisses.
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Di 24.08.04 14:38 
hallo,
also es ist so:
wenn ich wärend der laufzeit so einen langen string zuweise dann geht das ohne probleme.
wenn ich den string so zuweise dann meckert er, egal ob shortstring.
mfg
moloch
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Di 24.08.04 14:40 
guck mal in den compileroptionen ob die checkbox Huge String an ist. wenn nicht mach das mal.

_________________
si tacuisses, philosophus mansisses.
teebee
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 109


D6 Prof
BeitragVerfasst: Di 24.08.04 15:26 
Delphi Hilfe hat folgendes geschrieben:
Ein String in Anführungszeichen setzt sich aus einer Folge von maximal 255 Zeichen des erweiterten ASCII-Zeichensatzes zusammen, muß in einer Zeile stehen und in halbe Anführungszeichen eingeschlossen sein.
Wenn Du den String im Quelltext zuweist, musst Du ihn mit '+' in mehrere Segmente unterteilen, wenn er länger als 255 Zeichen ist.

Gruß, teebee
UC-Chewie
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 531

WinXP
D5 Ent
BeitragVerfasst: Di 24.08.04 15:31 
Eine einzelnes Stringliteral darf nicht länger als 255 Zeichen sein. Normalerweise ist das kein Problem, da man i.d.R. Zeilen nach etwa 80 Zeichen sowieso umbricht.
Jedenfalls kannst du das Problem lösen, indem du mehrere Stringkonstanten, die alle nicht mehr als 255 Zeichen haben, mit dem +-Operator verknüpfst.

_________________
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind