05-20-2006, 03:22 AM
05-20-2006, 03:42 AM
05-20-2006, 04:29 AM
TheAdventMaster: In that example the sub/function name isn't in a string...
Torahteen: AFAIK that is not possible, but you could set up an
array with sub names and their pointers
Pseudocode:
Torahteen: AFAIK that is not possible, but you could set up an
array with sub names and their pointers
Pseudocode:
Code:
type subListEntry
name as string
p as functionpointer
end type
dim shared subList(0 to ?) as subListEntry
sub init_sub_list
subList(0).name="sub0"
subList(0).p=@sub0
subList(1).name="sub1"
subList(1).p=@sub1
...
end sub
sub call_a_sub(sname as string,parameters)
for n=0 to ?
if subList.name=sname then
@subList.p parameters
exit sub
end if
next
end sub
Anonymous
05-21-2006, 03:18 PM
yeah, like red_Marvin said.
a hash table with function pointers would be the way to go.
a hash table with function pointers would be the way to go.
Anonymous
06-03-2006, 05:08 AM