Which is the best way to format/combine a string and a value in GLbasic ?
For example DrawSprite "Alien."
- where "Alien" is the sprite name and x is the index of an enemy you want to use, in this example 2, resulting in DrawSprite Alien.2.
Hope that makes sense.
number = 1
string$ = "Alien." + number + ".png"
PRINT string$, 0,0
SHOWSCREEN
MOUSEWAIT
Like this?
My guess is this is what he wants: Can't remember sprite/object numbers (http://www.glbasic.com/forum/index.php?topic=178.0)
Since he wants to draw a sprite with the name Alien.2 and so on, this code makes it easier :-)
Thanks guys. The first two answers were what I was looking for, although Moru's link will be handy for me too. Too many numbers give me brain freeze, it's like my brain has a small 1k memory cache. ;/
>for tight loops, a 1K cache is more than you need....
In that case...time to defrag my brain :S