how to... make a 'for 0 to x' variable that can insert digits IN an attribute name?

David McFarlane mcfarla9 at msu.edu
Thu Nov 5 18:24:19 UTC 2009


liwenna,

I applaud you for wanting to improve your coding skills and fussing 
over these little details.

FWIW, I would have come up with much the same line, only I might 
reduce the math a tiny bit, and I like to add just a few more 
parantheses for clarity:

For m = (4*p - 3) to (4*p)

But to be honest I don't know if that is any better or clearer than 
what you already did.

Cheers,
-- David McFarlane, Professional Faultfinder


At 11/5/2009 09:02 AM Thursday, you wrote:
>It is done and works just great... I am quite happy with it.... says
>the person who is known for having written out/copy pasted 200
>seperate lines of code to create breaks every 20 trials in the past
>^.^ (if triallist.sample = 1 then; if triallist.sample = 2 then...
>etc).
>
>Now I got one more thing to ask, seeing as I am trying to make this a
>decent piece of code... I needed a line that made 'm' (levels of the
>triallist) run from 1 to 4 if p (targetidentity) is 1, and run from 5
>to 8 if p =2, from 9 to 12 if p is 3 etc.
>
>This is what i came up with:  for m = 1 + 4*(p-1) to 4 + 4*(p-1)
>But I can imagine that there should be a shortcut for that, like mod
>or step.... so... is there? anyone?
>
>Once more thank you Ben!
>
>
>Greets,
>
>happy liw


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en
-~----------~----~----~----~------~----~------~--~---



More information about the Eprime mailing list