Code: Select all
select case key
case key_a
call sub_a()
case key_b
call sub_b()
case key_c
call sub_c()
' etc....
end select
Code: Select all
if key = key_a then
call sub_a()
elseif key = key_b then
call sub_b()
elseif key = key_c then
call sub_c()
' etc...
end if
My question. Is there another way to do this?
Can I do something like
Code: Select all
call sub correct_key(key)
Code: Select all
sub correct_key(key_a)
' that points to
sub key(key_a)
' and
sub correct_key(key_b)
' that points to
sub key(key_b)
Key as an index into a table of pointers to the Subs or something?
With my little programming experience I am not sure what this is called or if FreeBASIC can do it.
If there is another post on this topic or a tutorial I'll read them, if I knew
what they were called!
Thanks in advance. Elsairon