Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

setVariable

smidget edited this page Jul 19, 2012 · 1 revision

Purpose

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.

Parameters

Name (optional)

Sets the name of the variable being written back into OpenSHAPA

RVariable to write back

The variable that you want to write back to the database.

Examples

# 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)