hexagon logo

How to pass a virtual string array to a function?

I've defined a PCL function called "find_elem_id" which is called by another function. I'm passing an integer and a string array (VIRTUAL) in size to this function, and I'm getting this runtime error:
 
$# ===(PCL) Invalid data range for argument. Arg#: 2
$# ===Call traceback...
$#     Function SYS_ALLOCATE_ARRAY
$#     Function FIND_ELEM_ID, Line Number 837
 
I believe it is being caused by how I'm passing the string VIRTUAL array to the find_elem_id function (see below).
 
I tried defining the variable as strFoundGroups[32]() inside the find_elem_id function but that didn't help.
 
Can anyone see what I'm doing wrong?
 
Thanks.
 
STRING strFoundGroups[32](VIRTUAL)
find_elem_id (100,strFoundGroups)
 
$# ======================================================
FUNCTION find_elem_id ( intElementID, strFoundGroups )
 
 INTEGER intElementID
 STRING strFoundGroups[]()  $# <<--- this is causing a runtime error
 
 (do stuff here)
 
END FUNCTION
Parents Reply Children
No Data