ID:1441481
 
(See the best response by Nadrew.)
mob/proc/removeTags(var/tx,var/list/tags)
for(var/i to length(tx))
i++
if(findtext(tx,"<",i,i+1))
var/check_tx = copytext(tx,i+1, findtext(tx,">",i+1))
if(check_tx in tags)
continue
else
check_tx = copytext(tx, i-1) + copytext(tx, findtext(tx,">",i+1))
sleep(1)

Even though it's not a big deal.. this has been seriously ticking me off because I don't know why for every compile it's been saying this.

loading World Control.dme
loading Skin.dmf
Procs.dm:22:warning: i: variable defined but not used
saving World Control.dmb
World Control.dmb - 0 errors, 1 warning
Did you define another i and not use it because i don't see a i being defined here where is line 22?
for(var/i to length(tx))
Seems to be a bug actually.

Warning:
for(var/i to length(tx))


Fixed:
for(var/i=1 to length(tx))


While you can still compile.. You'll get an annoying warning. I like my console clean as a baby's bottom. Does anyone else think it's a bug?
Best response
The error it's generating is probably incorrect, but the code itself should be throwing some kind of warning since you shouldn't use uninitialized/null variables as the first argument in a for() loop since you'd have nothing to 'start' the loop from it wouldn't know where to go from there, remember 0 is not equal to null.
I was thinking about it.. But I didn't want the = sign in the for loop because it looked ugly to me. I ended up putting it in there anyways.

Thanks though.
In response to Xirre
Shouldn't be considered ugly. If you have an uninitialized variable that increments with no starting point, that would be very confusing for someone inheriting your code.
What you can do for these instances is use a preprocessor definition for something like

#define in =
// or
#define eachin =

for (var/i eachin 1 to 20)
// ...
In response to Makeii
How does this provide any inherit benefit, though?
In response to Insomniaddikt
Makes it look cuter to my eyes I guess.

I like the green. *nods*
You could always do:

var/i = 0
for(i to 10)


If you don't want to clutter the for() up, you end up defining a variable that exists outside of the scope of the loop, but it probably won't exist much longer than defining the same thing inside of the loop's scope so it's probably not too much more resource-unfriendly.
Even better. The less you have to write, the better. I'll change it up right now. Thanks.
    removeTags(var/tx, var/list/tags)
var/i = 1
for(i to length(tx))
if(findtext(tx, "<", i, i+1))
var/check_tx = copytext(tx, i+1, findtext(tx, ">", i+1))
if(check_tx in tags)
continue
else
if(i != 1)
tx = copytext(tx, i-1) + copytext(tx, findtext(tx, ">", i+1))
else
tx = copytext(tx, findtext(tx, ">", i+1))
sleep(1)
return tx


loading World Control.dme
loading Skin.dmf
Procs.dm:146:warning: i: variable defined but not used
saving World Control.dmb
World Control.dmb - 0 errors, 1 warning

I'm really beginning to think this is somewhat of a bug. The thing is.. I've even tried using src << "Test: [i]" inside the for loop.
Yeah, that seems a bit off; definitely shouldn't be triggering a warning in that instance. The original instance I understand, but in this case you're defining, initializing, and using the variable.