At 6:59 PM -0800 1/3/2001, Ellen C. Largo wrote:

>   -- find the number that match up correctly
>   numright = 0
>   repeat with i = 1 to correct.line.count
>     if value(correct.line[i] = gAnswerList[i]) then
>       numright = numright + 1
>     end if
>   end repeat


Hi Ellen,

You can retrofit that code without too much trouble to have multiple 
right answers. If you have many "multiple" right answers or there are 
lots of questions, it might get unwieldy but not too bad.

Using that existing structure- if you put the multiple right answers 
on the same line separated by some unique character that would not be 
in the answer (like | -pipe) then you can test if the answer = each 
item in the line. Items are determined by "the item delimiter" - the 
default for this is comma - but you can change it to any char. (I 
suppose a brute force method would be to simply check if each line 
"contains" the answer- depending on the nature of the Q/As, that 
might work, but its kinda nasty).

So:

   oldDelim = the itemDelimiter
   the itemDelimiter = "|"
   numright = 0
   repeat with i = 1 to correct.line.count
     thisLine = correct.line[i]
     repeat with myItem = 1 to thisLine.item.count
       if value(thisLine.item[myItem] = gAnswerList[i]) then
         numright = numright + 1
         exit repeat
       end if
     end repeat
   end repeat
   the itemDelimiter = oldDelim
end

You should probably store the correct answers in a global if you need 
to check them a lot- save a little time.


>Also, can anybody help our team, on the possibility of having a 
>program that will disable the software from running when the time 
>for a trial version has expired?  We intend to give a trial version 
>to the clients and after, let say two weeks, the program will be 
>disabled.


An easy though not by any means foolproof way is to just use setPref 
to write a little date file to their hard drive (assuming its not on 
CD). Then check it each time the program launches and compare to 
current date
-- 

     Roy Pardi
---------------------------------------------------------------
Contract Multimedia Developer   +  Lingo Programer
                                 [EMAIL PROTECTED]
---------------------------------------------------------------



[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to