When I compile the following code, the compiler gives an error in line 17:
| The variable 'arrVals' is too complex a type to be used in an expression.
| See error number -4340.
I am using Genero 3.1! What am I doing wrong? How can I get around of it?
I need to implement a callback scheme and this is important to do it.
type myFuncType function( p dynamic array of string ) returns integer
define f myFuncType
define callBackFuncs dictionary of myFuncType
define arrVals dynamic array of string
define x integer
main
let arrVals[1] = "str1"
let f = function f1
let callBackFuncs["funckey1"] = function f1
call f1( arrVals ) returning x
call f( arrVals ) returning x
call callBackFuncs["funckey1"]( arrVals ) returning
end main
function f1( p dynamic array of string ) returns integer
return p.getLength()
end function
Hello,
The x variable is missing in the line
call callBackFuncs["funckey1"]( arrVals ) returning x
Just tested with 3.20.12, same issue.
Not sure yet it's a bug of feature.
Try this workaround:
--call callBackFuncs["funckey1"]( arrVals ) returning x
let f = callBackFuncs["funckey1"]
call f( arrVals ) returning x
Thanks Sebastien,
The workaround works.
I any case I thing this is an bug.
I have other similar situations where it works to call directly the array cell.
The only difference are the type of the arguments of the function.
I couldn't find anything in the documentation that restrict this.
Bug reference: FGL-5531
Seb