Grid Run button: onRecord never executes

A simple Grid application.
A Run Button, “Check The Count”.

onScriptInit:
[i] = 0;
[arr] = array();

onRecord PHP:
$ind = [i];
[arr][$ind] = {_id};
[i]++;

onFinish PHP:
$tot = [i];
echo “The value of i is $tot”;

Check a bunch of items, click the button, and the result is always:
“The value of i is 0”

It’s very strange that onFinish executes, but onRecord does not.

onFinish PHP:
$tot = implode(",", [arr]));
echo "The value of arr is " . $tot;

// reset
[i] = 0;
[arr] = array();

[QUOTE=RHS;24102]onFinish PHP:
$tot = implode(",", [arr]));
echo "The value of arr is " . $tot;

// reset
[i] = 0;
[arr] = array();[/QUOTE]

That results in $tot == ‘’ - an empty string.

Yes, I have reset logic. The point is that onRecord never executes. [i] is always 0, and [arr] is always empty.

Update: I exported / deleted / imported the Grid application. It made no difference.

Perhaps in Grid / Application / Global Variable the var type is wrong?

The vars are set as SESSION / out.

Application->Global Variables shows them defined in Events(onInit) which is onScriptInit, and used in Buttons(Check onRecord)

Edit: Even though the above should work, ScriptCase docs indicate the correct settings are POST+GET / out.

http://www.scriptcase.net/samples/tutoriais/grid/grid46.php

That makes no difference either.

I have a grid with four run buttons, the variables set as POST+GET and OUT. This works without problems …

Can you export your app and upload it (dropbox or …)?

Too much sensitive code to upload the one I’m testing with.

I’ll try creating a basic grid app, duplicate (or not?) the problem, and upload that later today.

I appreciate your help. I suspect this is just some kind of odd corruption…

Try it this way.
onScriptInit:
[arr] = array();

onRecord PHP:
[arr][] = {_id};

onFinish PHP:
$tot = count([arr]);
echo "The count is ".$tot;

jsb