ID:178242
 
mob/verb/say(msg as text)
if(msg == null)
usr <<"> You must type something)"
else
world <<"
> [usr]: [msg]"

This doesn't work. Why?

ShadowSiientx wrote:
mob/verb/say(msg as text)
if(msg == null)
usr <<"> You must type something)"
else
world <<"
> [usr]: [msg]"

This doesn't work. Why?

Please close your tags.

The reason this doesn't work is that an empty message isn't null; it's "". You can fix this by changing your if() to this:
if(!msg)

That will handle both cases.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
ShadowSiientx wrote:
mob/verb/say(msg as text)
if(msg == null)
usr <<"> You must type something)"
else
world <<"
> [usr]: [msg]"

This doesn't work. Why?

Please close your tags.

The reason this doesn't work is that an empty message isn't null; it's "". You can fix this by changing your if() to this:
if(!msg)

That will handle both cases.

Lummox JR


Heres a demo (is bored)


mob/verb/say(msg as text) // The actual verb
if(!msg) // if they say nothing..
usr << "Say somthing!" // tells the usr he said somthing.
else // Else......?!?!
view() << "[usr]: [msg]" // For people in your view they hear what you say


RaeKwon