How do I do equivalent of chr(97)?

Get help using Construct 2

Post » Mon Apr 14, 2014 1:04 am

I need to set up 26 keyboard characters in code.

I can't seem to find an equivalent of

for "loop" = 0 to 25 do
KeyboardLetter set text chr(loopindex+97)

How can I do the chr bit?
B
37
S
9
G
5
Posts: 437
Reputation: 6,094

Post » Mon Apr 14, 2014 1:08 am

this will result in a string.

try str() to convert a string to a number.
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Mon Apr 14, 2014 1:12 am

Sorry, I wasn't clear I want the number to be converted to its ascii character

i.e., 65 would be "A" and 97 would be "a"
B
37
S
9
G
5
Posts: 437
Reputation: 6,094

Post » Mon Apr 14, 2014 1:24 am

Ok I am not sure if this is the best way but this seems to work

where temp goes from 97 to (97+26)

Browser.ExecJS("String.fromCharCode("&temp&")")
B
37
S
9
G
5
Posts: 437
Reputation: 6,094


Return to How do I....?

Who is online

Users browsing this forum: ivanski1983 and 4 guests