DAT cooking vs/ interactive data entrance question

I have a dat:

REFRESH_TRIGGER 0

I have a script monitoring that DAT for changes,
if the value is 1, the script does something then sets the value to 0
if the value is 0 (since it’ll get called again as the value changes back to 0) it does nothing.

if I set the value to 1 FROM THE TEXTPORT with my DAT opened, therefore manually, the value stays one even though the script runs.
Since the value stays one, I can test by right clicking on the script and running it that way, and the script correctly will set the value back to 0 when done,
so the question is what happens when I hit on a DAT cell that’s opened in my textport? why isn’t my script succeeding in reseting the value to 0 if I enter it manually but it works if I just run the script?

d

Actually there’s more to this issue, which may point to a bug?

here’s the script (say RefreshDevices):
set table = “…/IN/DATIn”
set rowname = “REFRESH_DEVICES”

set trigger = tabr($table,$rowname,1)

if ( $trigger == 1 ) then
#refresh
oppardetail -p …/DEVICES/AvailableDevices source >DAT:…/DEVICES/OpDetails

# set trigger to 0
table -r $rowname $table 0 1 0
echo table -r $rowname $table -1 1 0

endi


I’ve just tried to create another script (say TriggerScript) which does: table …/IN/DATIn 0 1 1 (my table currently only has one row)

what happens is that the first time I run TriggerScript, the DATin value becomes 1, triggers the RefreshDevices script which in the end sets the value to 0, but the second time I run TriggerScript the value becomes 1 but RefreshDevices is NOT triggered.

is this a bug or am I missing something?

SO… if I delay the table …/IN/DATIn 0 1 0 command by one frame, it works every time.

Again, is this a bug?
d