switch(type)
if("kage")
switch(country)
if("fire")
if(Kages["Hokage"])
user << "There is already a Hokage.";return 0
Kages["Hokage"] = M
world << "[M] is the new Hokage.";return 1
Problem description:
I got bad index, where its if(Kages["Hokage"])
ID:141565
Jan 22 2009, 12:22 pm
|
|
Code:
switch(type) Problem description: I got bad index, where its if(Kages["Hokage"]) |
Jan 22 2009, 12:24 pm
|
|
If you try and find the associated value of an element that isn't there, you'll get an error. Try if("Hokage" in Kages).
|
In response to Popisfizzy
|
|
I'm trying to find out if Hokage is null or not..
|
In response to Lundex
|
|
If Hokage isn't in the list, you'll know it's null.
|
In response to Lundex
|
|
Then do this:
if(("Hokage" in Kages) && Kages["Hokage"]) |