Which control mechanism?

Blitz3D Forums/Blitz3D Beginners Area/Which control mechanism?

Zace(Posted 2003) [#1]
Ok I have my network chat program working nicely. Now i want to add more functionality.

At the moment i have code like

if chat$="/who" then
print_list_of_users()
else
send_chat_to_network(chat$)
endif

howver i now want to check for chat starting /tell and /ver and i am sure a load more commands.

What should i use? (nested IF...Then.. or CASE or something else?)


Thanks


soja(Posted 2003) [#2]
The Select control allows for nice, readable code with a whole bunch of cases. That's what it's made for.


eBusiness(Posted 2003) [#3]
Personally I would use some Else If commands, but at runtime it probably doesn't differ much from Select.