I made exactly same function for one of my old games.
I didn't use OPTION STRICT,so my version doesn't have VAR statement.
Othar than that, it is almost same (mine uses S$ for the name of string parameter)
@Soan
Declaring I as a variable inside the function makes it a local variable. That way, if you're using I somewhere else in your program, you won't overwrite it when you call this function.
@ChangeV
I didn't know that, that's awesome!
@Ed
Makes sense, but what if you use VAR outside the function? Does it become a global variable or variable that can't be used inside a function? lol
@ChangeV
I've been drawing parallels to Python ever since I started playing around in SmileBASIC. It's good to know arrays can be used like that.