Its funny you bring that up. I was making a dialog for an SMS suggestion that was posted on here, and the number needs to be in XXX-XXX-XXXX format, so i used a while loop to "read" each number and place it in the proper syntax ex:
+----------------+ Number:
|1234567890 | 123-456-7890
+----------------+
Well, that worked find. I used:
var %a = 1
while ($mid($did($did), %a, 1)) {
And went through all the individual letters. Now, I was thinking "while the mid character is not null", so i figure im in the clear. It worked perfectly, but one problem. If i put a 0 anywhere in the number, that 0 and the following numbers were truncated...
+----------------+ Number:
|1034567892 | 1XX-XXX-XXXX
+----------------+
So now im thinking "wtf" its not working, its not null, whats going on here. Well, after echoing and debugging i found out that mid of the number (being 0) returns false in the while killing the loop. So now, i had to change it to
var %a = 1
while ($mid($did(dd), %a, 1) != $null) {
and worked fine ever since
Kida wierd of it worked out. You think "gonna return true cause its not null. It really should be a null-or-not condition and use variables that hold $true and $false not 1 and 0 for a condition. Similar to a bool type. >:D