[QUOTE=newt] [QUOTE=tulamide] [QUOTE=shinkan]...
sometimes i have to add empty "" for that to work and sometimes works without it :/
Although Construct tries its best to convert between numbers and text, you are free to explicitly convert to text with the expression 'str':
AppPath & str(random(10) + 1) & ".png"
This should work without exception.[/QUOTE]
Ampersand concatenates to string, so it should automatically be converted.
I've seen others use the plus sign, and it worked, but I can't think of a situation where that method would be better. [/QUOTE]
- That's what I said, Construct tries its best to convert.
- Never use the plus sign, the only sign you can rely on is ampersand.
- there are situations where Construct will be confused with the information given. Just create a text box and do:
+ System: Start of layout
-> Text: Set text to AppPath & random(10) + 1 & ".png"
Do you now see, where that str method would be better?
EDIT: Sorry, after posting I realized that Jayjay already gave that example.tulamide2011-07-07 16:45:14