Somebody mentioned that Strings are nothing but arrays. So, then, this code comes to mind. I use output variables as auto/local variables.
Oh, dear. Abuse of SmileBasic already. :p
Looking at your Mii, I thought that was you even before reading your text. Funny, eh? I don't know what you look like. Still don't.
I'm ultra busy since I take on a new job. I'd be lucky to get 1 hour per day. So far Pokemon Shuffle got it, but I may have to drop it soon in favor of this.
I'm having trouble changing the loop from FOR loop to WHILE loop. I keep getting error: Uninitialized variable in 0:11. Yet, the FOR loop version works just fine.
Got it! It seems SB doesn't like uninitialized return variables. It's also picky regarding function call format. Oh, well. Keep on learning new things, I guess. :)
I understand the concept of using output variables as auto variables, but is there any real purpose when you're always assigning an integer? Seems messy to always have to put the output value somewhere.
Also, my mind is being blown right now that functions and commands with a single OUT variable are completely interchangeable.
Yep. It is messy. Some languages allow you to ignore them when doing function call, hence my earlier confusion. I'm still learning things, though. The normal way to do it is via explicit stack, but push/pop is an extra line. Array variable is an extra var.
Of course, if you know of a better way, feel free to share! :D
You can use VAR to specify local variables. I usually use OPTION STRICT, which forces you to declare variables before they are used, so it's clear when I'm accessing a local variable in a function rather than a global variable.