Re: Gradient Background??

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Sun, 10 Dec 2000 12:51:55 -0500, Brian <impee3 at EXCITE.COM> wrote:

>I'm having a hard time creating a gradient background. I want it to fill in
>the background from black at top to a dark blue at the bottom. I keep
>getting a "Trying to redefine intY" error. Here's the code I'm using.
>
>procedure gradientbg()
>    atom intY
>    sequence gradcolor
>    for intY = 1 to 480 by 1
>    gradcolor = {0, 0, floor(intY / 480) * 255}
>    draw_line(gradcolor, {{1, intY},{640, intY}})
>    next
>    end for
>End Procedure
>
>Any ideas why this is happening?


Brian:

   You have 2 varibles in the procedure:

   1. atom intY

   2. The for loop is creating it's own variable intY

   In other words the variable you use in the for loop
   is automatically declared.

   Comment out the atom intY.


   Bernie

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu