ID:168491
Oct 8 2005, 11:25 am
|
|
Hmm, not really sure how to make a command to check all your vars that are active without having to make multiple lines. Any Ideas?
|
#define islist(L) (if(istype(/list,L))) I think that should work. References to atoms won't work out too well, but beyond that it is workable. The islist() define may be wrong, too. I can never get the order of arguments in istype() right... |
In response to Jp
|
|
Swap the /list with L for the define.
|
In response to Jp
|
|
Won't work. Your macro will expand to have two if()s, and the arguments to istype() are the wrong way around. =)
Corrected version: > #define islist(L) (istype(L,/list)) You can get a lot more complex with this kind of thing; supporting atoms, nested lists, and all kinds of things. There are libraries that do all the work for you already; http://developer.byond.com/hub/Gazoot/var_dump, for example. (I've never used it - I have my own personal unreleased library that includes these kind of things - but Gazoot's looks pretty good.) Deadron also has one (http://developer.byond.com/hub/Deadron/Debug). |
~~>Dragon Lord