Forum Moderators: coopster

Message Too Old, No Replies

constants vs vars

         

kumarsena

3:01 pm on Jan 16, 2004 (gmt 0)

10+ Year Member



just wondering, i have seen a lot of tutorials use constants instead of variables to define for example, image size or location.
just wondering, what are the benefits of using constants instead of variables?

thanks
kumar

Glacai

3:56 pm on Jan 16, 2004 (gmt 0)

10+ Year Member



Just a precaution so you don't accidently change the value within your program.

jatar_k

4:50 pm on Jan 16, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I use them for values that need to be defined across the system.

Constant == something that always remains the same
Variable == something that changes

I use them more in some applications than others.

kumarsena

4:19 pm on Jan 19, 2004 (gmt 0)

10+ Year Member



thanks guys