I am using the latest version of AppStudio (9.3.1.7) and using Voltbuilder to build my app for Android. It appears that the Basic to JavaScript conversion program has a problem with the Eval() and Execute() functions. I am trying to replace a long Select Case (see below) with something more elegant.
' Select Case TxnCode
' Case "31"
' Process31Txn(TxnData)
' Case "32"
' Process32Txn(TxnData)
' Case "33"
' Process33Txn(TxnData)
' Case "34"
' Process34Txn(TxnData)
...
When I try the following, I get no errors when I build the app (in release mode) but the code will not execute properly.
Eval("Process" & TxnCode & "Txn(TxnData)")
I believe that the Basic Code line get converted to JavaScript but it converts the “(“ and “)” to square brackets, so the line becomes:
eval(“Process” + TxnCode + “Txn[TxnData]”);
which is not what I want. BTW - When I highlight the Basic Code line in the AppStudio Editor and use the “View Javascript” fucntion, everythig looks fine.
When I do the following (by changing the way the parts are concatenated)
Eval("Process" & TxnCode & "Txn(" & "TxnData)")
or
Eval("Process" & TxnCode & "Txn" & "(" & "TxnData" & ")")
it appears to work fine but the line of code looks odd. It took me a quite a while to debug this issue.
Please have a look and see if there is a fix so thers don’t run into the same issue. I know that I could use Javascript.. End Javascript statements but then I wouldn’t have found the issue with the Conversion utility.
Kindest Regaards,