In your code, the line with 1 ball in the box was being executed, but 
then immediately overwritten with the final line.  You need an "else 
if" statement to tie all the if's together.

This might be a little clearner after slight restructuring:

   if count = 0 then
      sentence = "Mr Johnson says there are no balls in the box"
   else if count = 1 then
      sentence = "Mr Johnson says there is 1 ball in the box"
   else
      sentence = "Mr Johnson says there is" && count && "balls in the box"
   end if
   put sentence into field "mr_john_count"

Irv

At 6:08 PM +0000 12/4/01, Blundell, Steven Paul wrote:
>The following script updates a field called mr_johnson_count with the
>sentance below and the variable count! If the variable count = 0 it gives
>the correct sentance, if it is 2 or more it gives the correct sentance
>however it doesnt seem to be picking up the if statement that should trigger
>when count = 1. Can anyone shed any light as to why not?
>
>Thanks in advance
>
>Steve
>
>   if count=1 then put "Mr Johnson says there is" && count &" ball in the
>box" into field "mr_johnson_count"
>  if count=0 then put "Mr Johnson says there are no balls in the box" into
>field "mr_johnson_count"
>   else
>     put "Mr Johnson says there are" && count &" balls in the box" into field
>"mr_johnson_count"
>   end if
>   updatestage
>
>
>
>[To remove yourself from this list, or to change to digest mode, go to
>http://www.penworks.com/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!]


-- 

Lingo / Director / Shockwave development for all occasions. 
          
   (Home-made Lingo cooked up fresh every day just for you.)

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/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