MegatenFreak Active Member Licensed User Jun 10, 2020 #1 Hi. In my code, I wanna pass the name of a function to another module so it can run it when it wants (as a callback), since I can't pass the function itself as a parameter. But it doesn't work. the totally weird thing is that if I put in the function name directly, it works, but not when it's in a variable: Code: Copy 'This works perfectly: CallSub(Me, "Picked") 'But this doesn't: Dim name as String = "Picked" CallSub(Me, name) I don't understand what the difference is. And anyway, how am I supposed to tell my app to run that function?
Hi. In my code, I wanna pass the name of a function to another module so it can run it when it wants (as a callback), since I can't pass the function itself as a parameter. But it doesn't work. the totally weird thing is that if I put in the function name directly, it works, but not when it's in a variable: Code: Copy 'This works perfectly: CallSub(Me, "Picked") 'But this doesn't: Dim name as String = "Picked" CallSub(Me, name) I don't understand what the difference is. And anyway, how am I supposed to tell my app to run that function?
Erel B4X founder Staff member Licensed User Longtime User Jun 10, 2020 #2 Are you running in release (obfuscated)? Upvote 0
MegatenFreak Active Member Licensed User Jun 11, 2020 #3 Erel said: Are you running in release (obfuscated)? Click to expand... Yes. Ahhh... it's the obfuscation functionality! I just got it! It's because the function names get changed to vvvvv..., right? That certainly makes sense! It was driving me crazy! You nailed it, Erel! Thanks. Upvote 0
Erel said: Are you running in release (obfuscated)? Click to expand... Yes. Ahhh... it's the obfuscation functionality! I just got it! It's because the function names get changed to vvvvv..., right? That certainly makes sense! It was driving me crazy! You nailed it, Erel! Thanks.
Erel B4X founder Staff member Licensed User Longtime User Jun 11, 2020 #4 Add an underscore to the sub name: Code Obfuscation Upvote 0
MegatenFreak Active Member Licensed User Jun 11, 2020 #5 Erel said: Add an underscore to the sub name: Code Obfuscation Click to expand... Perfect? Upvote 0