ID:170641
 
Can someone explaine FOR and ! to me?

I use for alot

for(var/obj/test) after this usually and IF then yeah...

I can use for but I dont know...it sorry do you understand? Please explaine it, maybe an example. ! on the otherhand I DONT UNDERSTAND nor can I use. What is it used for? Example?
I may not be exactly correct, but I believe this is how these two things work-

!
I believe if you did something like if(!Blah) it'd work if Blah was either 0 or null, I'm not sure on this though.
An example would be
var/Blah=0
mob/verb/test()
if(!Blah)
world << "Boo"
else
world << "Wah"

This would do Boo and not Wah.
EDIT
I just remembered another use for !
Here's an example
var/A=1
var/B=2
mob/verb/test()
if(A!=B)//This will check if A does not equal B
world << "Boo"
if(A==B)
world << "Wah"

This will output Boo

for()
I believe when you use for it does whatever is indented under it for each thing, like if you did for(var/obj/O in M.contents) it'd do whatever was under it for each obj in M.contents.

I may be wrong, but I believe this is right.
Lilcloudy1 wrote:
Can someone explaine FOR and ! to me?

I use for alot

for(var/obj/test) after this usually and IF then yeah...

I can use for but I dont know...it sorry do you understand? Please explaine it, maybe an example. ! on the otherhand I DONT UNDERSTAND nor can I use. What is it used for? Example?

Cloudy! Erm...On to the topic. You should try using F1 on Dream Maker. Anyways, I'm pretty sure Artekia is right. ! I believe either checks if something is null or changes it to 1 or 0. Check the F1

Chance
In response to Chance777
Thank you. F1 doesnt give as much as you think. Even if it does, understanding it = problem, hence this thread.