/usr/share/opensesame/help/variables.html is in opensesame 0.27.4-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
<TITLE></TITLE>
<META NAME="GENERATOR" CONTENT="LibreOffice 3.4 (Linux)">
<META NAME="AUTHOR" CONTENT="Sebastiaan Mathôt">
<META NAME="CREATED" CONTENT="20101213;14321500">
<META NAME="CHANGEDBY" CONTENT="Sebastiaan Mathot">
<META NAME="CHANGED" CONTENT="20111031;12514700">
<STYLE TYPE="text/css">
<!--
@page { margin: 0.79in }
H1 { margin-bottom: 0.08in }
H1.western { font-family: "Arial", sans-serif; font-size: 16pt }
H1.cjk { font-family: "DejaVu Sans"; font-size: 16pt }
H1.ctl { font-family: "Lohit Hindi"; font-size: 16pt }
P { margin-bottom: 0.08in }
H2 { margin-bottom: 0.08in }
H2.western { font-family: "Arial", sans-serif; font-size: 14pt; font-style: italic }
H2.cjk { font-family: "Droid Sans Fallback"; font-size: 14pt; font-style: italic }
H2.ctl { font-family: "Lohit Hindi"; font-size: 14pt; font-style: italic }
A:link { so-language: zxx }
-->
</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H1 CLASS="western">The variable inspector</H1>
<P STYLE="margin-bottom: 0in">The variable inspector provides an
overview of all the variables that are used in your experiment and
could be logged using a logger item. Local variables (i.e., variables
that are only available from within an item, such as 'duration' in a
sketchpad item) are not shown. The variable inspector tries to
extract variables created in an inline_script item, although slight
mistakes may occur.</P>
<P STYLE="margin-bottom: 0in">For more information, see
<<A HREF="http://osdoc.cogsci.nl/usage/variables-and-conditional-qifq-statements">http://osdoc.cogsci.nl/usage/variables-and-conditional-qifq-statements</A>>.</P>
<H2 CLASS="western">Using variables in an inline_script item</H2>
<P>The preferred way to set variables in an inline script item is by
using:</P>
<P><FONT FACE="Courier 10 Pitch">self.experiment.set('var_name',
value)</FONT></P>
<P>The preferred way to retrieve variables in an inline_script is by
using:</P>
<P><FONT FACE="Courier 10 Pitch">value = self.get('var_name')</FONT></P>
<P>You can also get and set variables more directly, using:</P>
<P><FONT FACE="Courier 10 Pitch">self.experiment.var_name = value</FONT></P>
<P>and</P>
<P><FONT FACE="Courier 10 Pitch">value = self.experiment.var_name</FONT></P>
<P>This will usually work equally well, but is not preferred as it
circumvents OpenSesame's internal variable management system.</P>
<H2 CLASS="western">Why use self.experiment.set(), instead of
self.set()?</H2>
<P>The command</P>
<P><FONT FACE="Courier 10 Pitch">self.set('var_name', value)</FONT></P>
<P>will set a local variable, i.e. a variable which is not accessible
outside of the current inline_script item. To create global
variables, which can be logged and accessed from anywhere, use</P>
<P><FONT FACE="Courier 10 Pitch">self.experiment.set('var_name',
value)</FONT></P>
</BODY>
</HTML>
|