Re: Re: using a variable to increment another variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



andreithomazgmail wrote:
> (if (= nFrameAtual 6)
> (set! nOpacidadeCamada2 100)
> (set! nIncrementoCamada2 0)
> )
> 
> The second line was ALWAYS executed. I changed to:

If the second line was ALWAYS executed, it means nFrameAtual never had the 
value of 6. The first set! is executed when the condition is true. The second 
set! is executed when the condition is false.

If you meant for both set! statements to be executed only when nFrameAtual has 
a value of 6, then you need to put both statements inside a 'begin' as follows:

(if (= nFrameAtual 6)
   (begin
     (set! nOpacidadeCamada2 100)
     (set! nIncrementoCamada2 0)
   )
)

In the above, when nFrameAtual has a value of 6 it will execute all statements 
inside the begin block. If nFrameAtual has some other value, the two set! 
statements won't be executed.

-- 
Cheers!

Kevin.

http://www.ve3syb.ca/           |"What are we going to do today, Borg?"
Owner of Elecraft K2 #2172      |"Same thing we always do, Pinkutus:
                                 |  Try to assimilate the world!"
#include <disclaimer/favourite> |              -Pinkutus & the Borg

[Index of Archives]     [Gimp Developers]     [Gimp Users]     [Yosemite News]     [Epson Inkjet Printers]     [Scanners]     [Gimp's Home]     [Steve's Art]

&hbsp; Powered by Linux