This repository has been archived by the owner on Aug 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
setVariable
smidget edited this page Jul 19, 2012
·
1 revision
Write a variable back into the OpenSHAPA 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 OpenSHAPA
The variable that you want to write back to the database.
# Get the variable from OpenSHAPA
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)