Notifications
Clear all

[Closed] Add for loop count to variable

I want to make a for loop that takes the current loop count and adds it to a string name. So somthing like this:

	
 for i = 1 to multiSubCount do
 (
 local theBitmap  = bitmaptexture filename:"dummyPath"'"+i"'
 
 )

How would I go about doing this? Basically I want the variable to equal bitmaptexture filename:

bitmaptexture filename:“dummyPath1”

bitmaptexture filename:“dummyPath2”

bitmaptexture filename:“dummyPath3”

…and so on depending on the count of the for loop.

2 Replies

You would need to convert the number to a string to add it to the string needed for the filename.

for i = 1 to multiSubCount do
(
	local theBitmap = bitmaptexture filename:("dummyPath"+(i as string))
)

-Eric

Thanks for the reply, that works great