Attribute cell to lookup value?
Stephen Mattingly
ndlabmanager at gmail.com
Wed Nov 20 16:08:25 UTC 2013
thanks so much - this is very helpful!
On Wednesday, November 20, 2013 3:20:15 AM UTC-5, Paul Groot wrote:
>
> 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 <ndlabm... at gmail.com<javascript:>
> > 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+u... at googlegroups.com <javascript:>.
>> To post to this group, send email to e-p... at googlegroups.com<javascript:>
>> .
>> 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/ccb6aded-b598-4d11-86f4-df2ff6c8d057%40googlegroups.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/12d2baaf/attachment.htm>
More information about the Eprime
mailing list