Attribute cell to lookup value?

Paul Groot pfc.groot at gmail.com
Wed Nov 20 08:20:15 UTC 2013


Just a minor detail: instead of a while loop you could use a for-loop,
which is the preferred construction to iterate over an index, and is less
sensitive for infinite loop 'accidents'.

About your question: I think it would be a nice feature to be able to refer
to E-Basic variables inside list elements. However, the developers of
E-Prime used a different approach for dynamically loading list content:
1) the []-syntax to reference the content of another attribute (i.e.
[OtherAttrib])
2) nested lists

You can combine the two to pull values from another (nested) list. So, if
you put the four filenames in a nested ColorList, you could use these
values in the Train list. (Using the randomization settings of the
ColorList when populating the Train list.) In this case you probably have
to use the colon syntax to pull four values from the same nested attribute
for a single Train trial ([OtherAttrib:0] [OtherAttrib:1] etc.). So, in
your case you could place [OtherAttrib:0] in the Color1 attribute,
[OtherAttrib:1] in the Color2 attribute, etc.


Also see the attached example.

Cheers
Paul





On 20 November 2013 00:09, Stephen Mattingly <ndlabmanager at gmail.com> wrote:

> Hi All,
>    Is there any way for an attribute cell (within a list) to call for a
> value, rather than just use the value in the cell?
>
> currently, if i put a string variable name in the attribute cell in a list
> (e.g. randomColor(0) ), it tries to find a file name that is the variable
> name (tries to find file,"randomColor(0)" ). rather, i would like it to
> look up the value stored by the variable and use THAT string as a filename.
>
> as i build complexity  into this task, my current solution becomes a pain,
> but my current solution is below:
>
>
> ---
>
> i want to randomize a list of colors at the beginning, but to keep the
> value the same for the rest of the experiment.
>
> first inline
>
> Dim randomColor(3) as String
> randomColor(0)="red.bmp"
> randomColor(1)="blue.bmp"
> randomColor(2)="yellow.bmp"
> randomColor(3)="green.bmp"
> Randomize
> randomizeArray randomColor
>
> while ColorAssignCount < 49  '48 training trials
>
> Train.SetAttrib ColorAssignCount, "Color1", randomColor(0)
> Train.SetAttrib ColorAssignCount, "Color2", randomColor(1)
> Train.SetAttrib ColorAssignCount, "Color3", randomColor(2)
> Train.SetAttrib ColorAssignCount, "Color4", randomColor(3)
>
> ColorAssignCount = ColorAssignCount + 1
>
> wend
> --
>
> it would be simpler to be able to call, within each list,
> 'randomColor(0)', as i will eventually have many lists and other elements
> that need randomization in a similar way.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "E-Prime" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to e-prime+unsubscribe at googlegroups.com.
> To post to this group, send email to e-prime at googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/e-prime/05910ed9-26aa-4638-9a92-a629eb513946%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/CAKAdR-vjDQRCa9ck5k03kB_csgSveOT0Vs06PocujHEa4pGQjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20131120/d7b4638c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NestedReference.es2
Type: application/octet-stream
Size: 38002 bytes
Desc: not available
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20131120/d7b4638c/attachment.obj>


More information about the Eprime mailing list