Hi,
This is a nice idea, and I was hoping I could use it. I modified your code slightly to do a test, and it worked!
At first, anyway:
Code: Select all
Let>Test=Here are some nice numbers 1 4 AB 3 66 C7 22 1234 Hello 2 22 44 222
Separate>Test, ,m1
ArrayCount>m1,v_before
MDL>There are %v_before% elements in the array before the SRT
//Return the values
MDL>Yep: %Z1_7%
MDL>%Z1_7%
Gosub>calc,"m1","res1"
//SRT to do generic calculation
SRT>calc
//Get array name and count elements
ArrayCount>calc_VAR_1,v_after
Length>calc_VAR_1,v_len
MDL>count is %v_after% and len is %v_len%. Calc var 1 is NOT an array
RegEx>\w\d,calc_VAR_1,0,Match,NM,0
// Notice that Match is the array, and Match_1 is the first element in the array
ArrayCount>Match_1,ct_element_1
MDL>After the RegEx, the array count for the first element of Match is : %ct_element_1%
//Unlike the original array, this fails to return the value
MDL>Nope: %Match_1%_7
//but this does return the element value
MDL>%Match_1%_7
END>calc
Don't ask me why I did this, but all I did was change the variable from m1 to MY_ARR..that didn't work. Neither did Z, or z, but when I tried z1, that worked. Next, I tried z2. That worked too. Then I tried Z1. That also worked. I tried Z11; failure. Finally, I tried 1Z and that failed. So in my limited testing, I found that you must name the array you wish to pass with a single letter and a single digit, in that order. Everything else fails.
Next, I took it a step further. Instead of RegEx or Separate, I did a DBQuery, returning my records into a recordset array m1. At this line:
Code: Select all
MDL>There are %v_before% elements in the array before the SRT
I found that there were zero elements in the recordset array. I'm not sure if it acts this way because the array is multidimensional, or if it is because there's something different about a recordset. Either way, that made the rest of the test fail.
So, you have to be very careful about the name of the array variable you pass, and you can't pass query recordsets. You also have to take care to isolate the values before you do much of anything with them.
Bummer.
It would be great to be able to pass an entire array, and an entire recordset.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey