Sub example(val1 As Int, val2 As Int) ' declare any type of variable you need
Log("Value 1=" & val1 & " Value 2=" & val2)
End Sub
' call using...
example(variable1, variable2)
Or of course you could use a global variable inside your sub?
Or do you mean...
B4X:
Select var
Case "example"
example(variable1, variable2) 'sub call to example
Case "example2"
example2(str1, str2) 'sub call to example2
Case Else
anothersubname 'sub call to anothersubname
End Select
This is not quite dynamically calling of a Sub but I don't know of another way.