Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Shadowfax
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 20th Jan 2003 16:15
I am having some difficulty with the #constant keyword. It is possible to define a constant with a value, i.e
#constant constA 5
#constant constB 10

But does not seem possible to define constants with constants, i.e
#constant constC (constA + constB)
as this will yield constC holding the value of 0

It is possible to define a constant using a variable but the value of the constant will alter when the variable value is altered. i.e
var = 13
#constant constD (var + 7)
constD will hold the value 20 but if the variable is then incremented
var = var + 1
constD will then hold the value 21, so constD is not taking the value of var at the time the constant is defined but making some form of reference to var

Is the #constant keyword actually some form of macro and is it possible in any way to define constants in terms of other constants ?
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 20th Jan 2003 16:49
No, you cant define constants in terms of others :

#constant FIRST

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 20th Jan 2003 16:50
Sorry, pressed the wrong key, anyway :

#constant FIRST 0
#constant SECOND FIRST+1

also seems to return 0 for both FIRST and SECOND.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!

Login to post a reply

Server time is: 2025-05-17 09:59:04
Your offset time is: 2025-05-17 09:59:04