I encountered a difficult-to-find error when compiling my app to release (obfuscated) when checking if a class implements a particular method with SubExists.
It appears that whilst CallSub works fine in obfuscated mode (e.g. CallSub(myObject, "mysub")) as the string "mysub" is translated, it appears that SubExists(myObject, "mysub") does not.
Consider the snippet below, with myobject as a custom class that has one method, "getTitle"
This will log nothing.
If however, I change this slightly to the below, then I obtain something in the log:
My question is, is this expected behaviour for SubExists versus CallSub when obfuscating?
I've attached a sample project. Running it in "Release" mode works fine, however, running it with "Release (obfuscated)" does not.
It appears that whilst CallSub works fine in obfuscated mode (e.g. CallSub(myObject, "mysub")) as the string "mysub" is translated, it appears that SubExists(myObject, "mysub") does not.
Consider the snippet below, with myobject as a custom class that has one method, "getTitle"
MyClass:
Private Sub Class_Globals
End Sub
Public Sub Initialize
End Sub
Public Sub getTitle as String
Return "Hello World"
End Sub
Main:
Dim myobject as MyClass
myobject.Initialize
If SubExists(myobject, "getTitle") Then
Log(CallSub(myobject, "getTitle"))
End If
This will log nothing.
If however, I change this slightly to the below, then I obtain something in the log:
Main:
Dim myobject as MyClass
myobject.Initialize
Log(CallSub(myobject, "getTitle"))
My question is, is this expected behaviour for SubExists versus CallSub when obfuscating?
I've attached a sample project. Running it in "Release" mode works fine, however, running it with "Release (obfuscated)" does not.
Attachments
Last edited: