Autor Beitrag
bfelix
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 61

WIN 2000 Prof., Win XP Prof., Win 7 Starter und Prof., SuSe Linux 11.3,
Delphi 7 Pers.
BeitragVerfasst: Mo 14.02.11 19:24 
Hallo Community,
ich würde gerne einen String komplett großschreiben, egal was davor Groß- und Kleinbuchstabe war, und in einem neuen String speichern. Ich habe es bereits mit diesem Code probiert:
ausblenden Delphi-Quelltext
1:
2:
for u := 1 to Length(str3) do begin
   str[u] := UpCase(str3[u]);

str3 ist die Ausgangsvariable und str die Ausgabevariable.
Allerdings quittiert Delphi das unter dem Ausführen mit folgender Fehlermeldung:
Zitat:
Zugriffsverletzung bei Adresse[ 00453BFD in Modul 'Project1.exe'. Schreiben von Datei 00000000.


Findet irgendwer einen Fehler oder hat eine bessere Möglichkeit?
Ich arbeite unter Windows 7 mit Delphi 7.

Danke,
BFelix
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 14.02.11 19:27 

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Tranx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 648
Erhaltene Danke: 85

WIN 2000, WIN XP
D5 Prof
BeitragVerfasst: Mo 14.02.11 20:00 
Hast Du str denn überhaupt Speicherplatz zugeordnet?

Ansonsten wäre wirklich die Zuweisung:


ausblenden Delphi-Quelltext
1:
  str := AnsiUppercase(str3);					


die einfachste Methode!

_________________
Toleranz ist eine Grundvoraussetzung für das Leben.