Android Question ObjectName.AS(class_name_variable).function

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Is it possible to have the AS(.....)
Be a variable name
Can something be done

Dim class1 as class_1
Dim class2 as class_2

Dim use_class as object
Dim class_type as object

use_class = iif(Pick_,Which_One, class1, class2)
class_type =iif(Pick_Which_One, class_1, class_2)

use_class.as(class_type).CallRoutine


I know I've made as clear as mud. What I would do is use a variable inside of the ( ) so I can call any command from the selected

Can a variable containe the AS type

Just wondering
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
That example gives me a good idea.

But instead of doing a

For Each c As Object In characters
CallSub(c, "Attack") 'duck typing
Next

How can i do

Wait for(c, "Attack") complete
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
maybe
B4X:
Wait For (CallSub(c, "Attack")) Complete
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…