B4J Question How to call subs from a list of subs?

Mark Read

Well-Known Member
Licensed User
Longtime User
I am working on a series of animations for my app. Each animation is stored in a sub which can also be recursive (calling itself). A global timer should then change the current sub on each tick(eg. every 2 minutes). Each sub has no inputs or outputs but calls a further two subs in series. I would like to make a list with the animation subs and call each one after a timer tick. Something like:

1. App start and initialise all variables.
2. Call sub 1 (which uses subs A & B)
3. Start timer
4. Keep running sub 1 untill timer tick is called.
5. Call sub 2 (also uses subs A & B).
6. Keep running sub 2 untill timer tick is called.
7. Call sub 3 ......

I think this would work with a counter and select case, but how do I call the sub after getting its name from a list (or map)?

Or is this not possible?
 

Mark Read

Well-Known Member
Licensed User
Longtime User
Okay, so I can create a list of subs in a list and select each one in order (backwards or forwards), which is exactly what I wanted. The component in this case is "Main" or "Me"? I only have the one activity , no classes or such like.
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Great Danke Klaus.
 
Upvote 0
Top