I am hunting an error that manifests only when an app is packed as UWP to go into the Windows Store.
I am trying to get name of the method where the exception occurs in a 2016R3 app.
This triggers at compile : “Too Many arguments: got 1, expected only 0.”.
[code]Function UnhandledException(error As RuntimeException) Handles UnhandledException as Boolean
System.debuglog("error.Message: " + error.Message)
System.debuglog("Reason: " + error.Reason)
System.debuglog(“Stack ubound: " + str(error.stack.Ubound))
for i as integer = 0 to error.Stack.Ubound-1
dim s as string = error.stack(i) // Here is the too many arguments
System.debuglog(“Stack N°” + str(i) +”: " +s)
next
End Function
[/code]
I read the LR several times. error.stack() is supposed to be a string array. I can even get the ubound.
[code]Function UnhandledException(error As RuntimeException) Handles UnhandledException as Boolean
System.debuglog("error.Message: " + error.Message)
System.debuglog("Reason: " + error.Reason)
Dim stack() as string = error.stack
for i as integer = 0 to Stack.Ubound-1
dim s as string = stack(i) // No more error
System.debuglog(“Stack N°” + str(i) +": " +s)
next
We have the same problem with plugin.
Stack is a function to return the array.
But you can’t use it immediately. You have to put it in temp variable.
Alternative we can add a “name(index as integer) as string” function for our arrays in addition to “name as String()”.