forked from OpenSHAPA/openshapa
-
Notifications
You must be signed in to change notification settings - Fork 19
setVariable
Jesse Lingeman edited this page Mar 6, 2013
·
2 revisions
Write a variable back into the Datavyu database. NOTE: If you do not write a variable back, then no changes made to the variable inside of a Ruby script will be saved back to the database.
Sets the name of the variable being written back into Datavyu
The variable that you want to write back to the database.
# Get the variable from Datavyu
trial = getVariable("trial")
# Change something
for cell in trial.cells
if cell.onset == 0
cell.change_arg("onset", 1000)
end
end
# Now write back the changes
setVariable(trial)
# Alternatively, you can write it back to a new column, keeping both
setVariable("modified_trial", trial)