Log in

View Full Version : How can i do this?



ilklhl1Lihl1
06-02-2012, 11:43 PM
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
06-02-2012, 11:54 PM
Ord(); - If I understand your post correctly.

Frement
06-02-2012, 11:57 PM
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
06-03-2012, 12:05 AM
thank you :)