inputlist
var
list/L = new/list()
Msg = ""
Title = ""
Def
T = null|anything
New(var/msg = Msg,var/title = Title,var/list/items = L,var/default = Def,var/Type = T)
Msg = msg
Title = title
L = items
Def = default
T = Type
return ..()
proc/Add(var/item)
L.Add(item)
proc/Remove(var/item)
L.Remove(item)
proc/Edit(var/msg = Msg,var/title = Title)
Msg = msg
Title = title
proc/Show(var/mob/M,var/default = Def,var/Type = T)
Def = default
T = Type
return input(Usr=M,Msg,Title,Def) as T in L
Problem description:
main.dm:26:error: Bad input type: T
That error comes up for the last line of the code. Im guessing that the problem is the compiler cant do somthing that I thought it could. So the compiler cant recognize the value of T? I thought null and other such things were just like flags that were or read together bitwise. So any way to make this code work?
Its no biggy Im just messing around with datum. Seeing what I can design with it. I think Lummox Jr called it the abstract objects O.o.
The input types (such as null and anything) used in this instance are worked specially internally. You can see that they do not actually have a value if you try to output them.
Of course, if you tried to output null that work work though; because it also has a use outside of this application.
I think I suggested back in my older post that they be changed so that we can mess around with them. They should be turned into bit flags. Not only could it be used for convenience, as in what you are doing, but it could also be a more powerful way to do things as you would not need to have switch statements to take care of variable input types.
It would be nice if we could do something like that.