SRL Archive - OSR Help

Please need a little help(changeing text cases))


bud_wis_er_420

2012-01-03 18:51:37

How do I do this below


text := Upper('text');
writeln(text);

and would print out this: 'Text'

YoHoJo

2012-01-03 18:52:34

Writeln('The UpText is: ' + GetUpText);
Should do it I think!]

OOPS ROFL! NEVER MIND!


Try UpperCase instead of Upper

bud_wis_er_420

2012-01-03 18:56:28

From: YoHoJo
Writeln('The UpText is: ' + GetUpText);
Should do it I think!]

OOPS ROFL! NEVER MIND!


Try UpperCase instead of Upper


UpperCase changes all the letters to uppercase I'm just trying to change the first letter.

Brandon

2012-01-03 19:27:30


program new;
{$I SRL/SRL.Simba}

Function FLU(str: String): String;
begin
Str[1]:= UpperCase(Str[1])[1]
Result:= Str;
end;

begin
Flu('dfsgs');
end.

Kyle Undefined

2012-01-03 19:31:31

Isn't there a Capitalize function? I could swear we had one.

bud_wis_er_420

2012-01-03 19:50:23

ok I see

program new;
var
text: string;

begin
text := 'hello';
writeln(Capitalize(text));

end.

bud_wis_er_420

2012-01-03 20:15:18

what am I doing wrong here?
[Error] (11:30): Type mismatch at line 10
Compiling failed.


program new;
var
text,Captext,Lowertext,Alltext: TStringArray;
next: integer;
begin


text := ['hello', 'bot', 'sup']

Captext := Capitalize(text);
Lowertext := Lowercase(text);
Alltext := Captext + Lowertext
For next := 0 to high(Alltext) do
begin
writeln(Alltext[next]));
end;
end.

Kyle Undefined

2012-01-03 20:16:31

Need to do Capitalize(text[x]), and the same for the others.

bud_wis_er_420

2012-01-03 20:20:24

I need to loop it though, huh?

Kyle Undefined

2012-01-03 20:21:15

Yup :)

bud_wis_er_420

2012-01-03 20:25:05

This what I came up with, but it's not working.


ok this what I have now but it still not working

program new;
var
text,Captext,Lowertext,Alltext: TStringArray;
next: integer;
begin


text := ['hello', 'bot', 'sup']
SetLength(Captext, high(text));
for next := 0 to high(text) do
Captext[next] := Capitalize(text[next]);

//Lowertext := Lowercase(text);
//Alltext := Captext + Lowertext
for next := 0 to high(Captext) do
begin
writeln(Captext[next]);
end;
end.

Silent

2012-01-03 20:48:32

From: bud_wis_er_420
This what I came up with, but it's not working.


ok this what I have now but it still not working

program new;
var
text,Captext,Lowertext,Alltext: TStringArray;
next: integer;
begin


text := ['hello', 'bot', 'sup']
[B]SetLength(Captext, length(text)[/B]);
for next := 0 to high(text) do
Captext[next] := Capitalize(text[next]);

//Lowertext := Lowercase(text);
//Alltext := Captext + Lowertext
for next := 0 to high(Captext) do
begin
writeln(Captext[next]);
end;
end.


See bolded.

EDIT: Just realized I left part of the previous code there, my bad.

bud_wis_er_420

2012-01-03 21:02:31

Thx