SRL Archive - Help

How can i do this?


ilklhl1Lihl1

2012-06-02 19:43:01

I want to go into a string char by char and take this char and convert it with the function chr() i don't know what function is used in simba,

i tried this

for i:=0 to length(s) do
begin
char:=s[i];
byte:=chr(s[i]);

inc(i);
end;

s is a string
i is a integer , char a string , byte an integer

ShawnjohnSJ

2012-06-02 19:54:57

Ord(); - If I understand your post correctly.

Frement

2012-06-02 19:57:24

Example:
program new;
var I: Integer;
S: String;
C: Integer;
begin
S := 'My string!';
for I := 1 to Length(S) do begin
C := Ord(S[I]);
Writeln('Char: ' + ToStr(C));
end;
end.

ilklhl1Lihl1

2012-06-02 20:05:26

thank you :)