Autor Beitrag
Conny Drexler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44


D6 prof. win xp
BeitragVerfasst: Do 01.07.04 11:18 
Gibt es im delphi irgendeine Funktion, ähnlich Upcase aber wo man ganze Strings gleich in Großbuchstaben umwandeln kann???

gibt es eigentlich auch die gleiche funktion für Kleinbuchstaben?????


Moderiert von user profile iconTino: Topic aus VCL (Visual Component Library) verschoben am Do 01.07.2004 um 14:12
Moderiert von user profile iconKlabautermann: Topic aus Sonstiges verschoben am Do 01.07.2004 um 16:22
Stauch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 140

Win 2000, Win XP
D4
BeitragVerfasst: Do 01.07.04 11:22 
Soweit mir bekannt ist, 2x NEIN. Ist aber kein Problem, eine upcaseString-function zu basteln. (oder downcase)

_________________
Geht das? Und wenn ja, warum nicht?
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Do 01.07.04 11:33 
Hallo,

ja, gibt es. Die Funktion heißt UpperCase und verbirgt sich in der Unit SysUtils.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
Jetstream
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 222



BeitragVerfasst: Do 01.07.04 11:40 
hmmm da ja alle Buchstaben über Ascii kodiert sind, kann man sich ja ganz einfach ne Funktion für Upcase basteln:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
function Upcase(Eingabe:string):string;
var index:integer;
begin
  for index:=1 to length(Eingabe) do 
    if (ord(Eingabe[index])>96)and(ord(Eingabe[index])<123) then Eingabe[index]:=chr(ord(Eingabe[index])-32);
  Result:=Eingabe;
end;


Entsprechend für Downcase:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
function Downcase(Eingabe:string):string;
var index:integer;
begin
  for index:=1 to length(Eingabe) do 
    if (ord(Eingabe[index])>64)and(ord(Eingabe[index])<91) then Eingabe[index]:=chr(ord(Eingabe[index])+32);
  Result:=Eingabe;
end;


müsste jedenfalls klappen, hoffe es hilft irgendwie.

//Edit: Hatte vergessen überhaupt Result zuzuweisen :D Dummer Fehler. :lol:


Zuletzt bearbeitet von Jetstream am Mo 05.07.04 12:06, insgesamt 1-mal bearbeitet
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Do 01.07.04 12:06 
Warum irgendwas basteln wenn es das schon fertig gibt.. :roll:

smiegel hat den Namen eh schon gepostet.. die Funktion heißt UpperCase bzw gibt es auch noch AnsiUpperCase (für mehr Infos zu den beiden Funktionen einfach in die Hilfe gucken..) :)

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!