Finding the right comments
gilis
giladsabo at gmail.com
Tue Oct 18 21:17:01 UTC 2011
In continue to my former question I would like to update that I
believe that I find the solution though the problem is that I've tough
time to find the right commands in eprime. First, in short, this is
what I want to do: I've one main list, in this list there are about 10
nested blocks, each block contain an attribute with 10 words and from
this attribute the slide object take the word to present each time, so
the selection of words from this attribute is set to random. Each
block run several times so though the selection of words is random, it
could happen that the same word repeat itself twice in the same block
(and I don't want it). The solution I was thinking about go like that:
Dim blocknum, blockname as integer
Blockname=c.GetAttrib(“block_name") ' each block has its own name,
that's important
do ' starting loop statement
Dim Comparison as Boolean 'setting another important variables
Dim worda as string
Dim wordb as string
Dim n as integer
N=n+1 ' counting the number of words that were presented, so each word
has its own ordinal number
If mod n/2=0 then 'well, I don't know the right command in eprime, but
I try to see if there is remnant when dividing n by two to conclude if
it's odd or even
c. SetAttrib “word1”, c.GetAttrib(“word”) 'in the case that n is
even number keep the last word in attribute word1
else
c.SetAttrib “word2”, c.GetAttrib(“word”) ' in the case that n is odd
number, keep the last word in attribute word2
end if
c.GetAttrib(“word1”)=worda 'worda= the last word or the
last-1 word
c.GetAttrib(“word2”)=wordb 'wordb= the last-1 word or the
last word
if worda=wordb then 'the Boolean variable is false
in case that two consecutive words are actually the same
Comparison= false
Else
Comparison=true 'if the two consecutive words
are different then the Boolean variable is set to "true"
End if
If Comparison = false then
randomarray(List.&Blockname) 'well, I actually want to randomly
select another word from the current block as long as Comparison value
is false but this is obviously not the right command-help is
needed
end if
Loop until Comparison=true 'loop until different word is chosen
N=0 'reset n value because there is no problem that two consecutive
words will be the same if they are in different blocks and if n is not
reset then the algorithm will prohibit such cases
--
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