get current procedure from nested list

David McFarlane mcfarla9 at msu.edu
Tue Mar 11 20:07:30 UTC 2014


Lisa,

This was rather too complex for me to read through, but I have just a 
couple of thoughts.

First, the .edat file already contains a Procedure column for each 
logging level, and the currently running Procedure name is always 
available as a Context attribute at runtime (e.g., 
c.GetAttrrib("Procedure")) , so I don't know why that does not 
already do what you ask.

Much more importantly, as a general rule, one should *not* run 
Procedures from nested Lists.  For all I know you have a good reason 
in this case, but I want to make sure to discourage newcomers from 
this bad habit.  Generally much more sound to run Procedures only 
from a main un-nested List, and use nested Lists only to supply 
values that will the be used by the Procedures named by the main 
List.  Typically, running Procedures from nested Lists is a sign that 
the programmer has not fully thought through the design, and 
untangling that will likely solve many problems besides the immediate 
one (but again, you may have a good reason in your particular case).

Regards,
-- David McFarlane


At 3/11/2014 03:29 PM Tuesday, Lisa Kaggen wrote:
>I have a task where 50 pictures appear in a random order, and in one 
>of 4 locations, randomly. To program this, I created 50 nested lists 
>within my TrialList, and then within each nested list, created 4 
>different levels each with a different procedure that consists of 
>showing an image in 4 different locations on a slide object - the 
>nested lists then randomly select one of those levels/procedures to 
>display (not the most efficient method, but it works). All I need to 
>do is create a string variable of which level/procedure was used 
>(because ultimately I need to integrate this variable into some code 
>that allows it to send messages to the eyetracker we're using, which 
>I already know how to do). The solution I came up with was to go 
>through each of the nested lists, and create a 'picture' variable 
>specific to each procedure and implement this code:
>
>''determine which nested list is being used currently
>Dim procname As String
>
>procname = c.GetAttrib("Running")
>
>''determine which level of the nested list was chosen
>
>Dim imglocation As String
>
>imglocation = procname.GetCurrentAttrib("picture")
>
>**insert eyetracking message code here referring to "imglocation" variable**
>
>However, the creation of a 'picture' variable for 4 different 
>procedures across 50 nested lists will be pretty time consuming, and 
>I'm also not sure it will even work (can someone weigh in on that?). 
>Does anyone have a solution for retrieving the current 
>level/procedure (not current list) and setting it as a variable?
>
>Many thanks!
>
>Lisa

-- 
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/531f6d0f.e272320a.5908.ffff8de7SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/d/optout.



More information about the Eprime mailing list