How do I convert int to string

Get help using Construct 2

Post » Thu Apr 02, 2015 5:48 am

i'm doing a for loop to dump some data into an array(games)
the storage.get function requires a string as parameter
but data in storage are actually number for this field
Image
i set var tmp_j as text
but i fear that loopindex("j") returns as a int and that the rest of my code stops working, the array becomes correct for the first loop(0) but does not work for the rest,
any ideas on how to pass ints to strings in functions?
Last edited by kaiko on Thu Apr 02, 2015 8:04 am, edited 1 time in total.
B
9
S
2
Posts: 76
Reputation: 709

Post » Thu Apr 02, 2015 5:53 am

sorry there was suppose to be an image with the code attached but i fail to find the upload pic button anymore, has it been removed?
B
9
S
2
Posts: 76
Reputation: 709

Post » Thu Apr 02, 2015 7:32 am

Forum uploads have been disabled for now until a nasty bug can be eliminated.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
129
S
29
G
77
Posts: 5,184
Reputation: 54,273

Post » Thu Apr 02, 2015 7:40 am

the code is as follows:
Image
B
9
S
2
Posts: 76
Reputation: 709

Post » Thu Apr 02, 2015 8:52 am

j&""
B
32
S
6
G
2
Posts: 317
Reputation: 2,801

Post » Thu Apr 02, 2015 9:04 am

thanks but when i try that c2 gives me a error message:"J needs an expression after it"
B
9
S
2
Posts: 76
Reputation: 709

Post » Thu Apr 02, 2015 5:40 pm

str(42)

Or conversely:

int("42")
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,365
Reputation: 4,724


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, ephrisian, TheSynan, Yahoo [Bot] and 7 guests