Echo/ max count

dkmcf mcfarla9 at msu.edu
Fri Jan 29 01:55:49 UTC 2010


Tobias,

I misinterpreted your Problem 2 earlier -- you want a correct response
that consists of a fixed length string that also contains each
character from a single set of multiple characters, in any permutation
order.  And you already got this sorted, but I want to present an
alternative algorithm that needs only a single If...Then statement.
In fact you could do this in nothing but one If...Then, but for
clarity I add a few variables.  So in your case this looks like

Dim  resp
Dim  cresp1 as String, cresp2 as String
resp = response.RESP
cresp1 = Mid$( response.CRESP, 1, 1 )
cresp2 = Mid$( response.CRESP, 2, 1 )
If ( (InStr( resp, cresp1 ) > 0) and (InStr( resp, cresp2 ) > 0) ) _
    Then response.ACC = 1
' .ACC = 0 by default, so no need to treat that case.

I like this mostly because it is more general and scales well for
longer response strings (although more efficient algorithms no doubt
exist).  You might also want to combine that with a test to make sure
first that the response string is of the proper length, depending on
your solution to Problem 1.

-- David McFarlane, Professional Faultfinder


> Problem 2
>
> - how can I specify two correct answers in the response key options?
> Can I enter two if max count > 1? will it also count ENTER as one
> reponse if that is my termination response?

-- 
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