--- In flexcoders@yahoogroups.com, Gordon Smith [EMAIL PROTECTED] wrote:
If I need something like pi as a const I would declare a class member
const for pi, not a function scoped const var.
If you needed to use this constant in only one method, declaring it as a
class member would be a
I think you still pretty much get the concept of const.
It means the value of yyy cannot be changed after initialisation.
To actually see it used in methods like this.. I assume the example
you gave is a bit 'stripped down' :p
If I get it correctly, everything is ActionScript is passed by
Actually I wouldnt mind betting that code of yours would run without
any error at all, native types are passed by value not reference.
--- In flexcoders@yahoogroups.com, johantrax [EMAIL PROTECTED]
wrote:
I think you still pretty much get the concept of const.
It means the value of yyy
Then it's out of my league, perhaps someone from Adobe could help us
out? (subtile hint ;)
--- In flexcoders@yahoogroups.com, reflexactions [EMAIL PROTECTED]
wrote:
Actually I wouldnt mind betting that code of yours would run without
any error at all, native types are passed by value not
to that constant only as part of the declaration or inside the class
constructor.
Paul
- Original Message -
From: johantrax [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, December 20, 2007 12:14 PM
Subject: [flexcoders] Re: const?
Then it's out of my league
can
assign a
value to that constant only as part of the declaration or inside
the class
constructor.
Paul
- Original Message -
From: johantrax [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, December 20, 2007 12:14 PM
Subject: [flexcoders] Re: const
- Original Message -
From: reflexactions [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, December 20, 2007 1:41 PM
Subject: [flexcoders] Re: const?
Thanks for the advice,
Maybe you could read the question, I am talking about Adobe declaring
a const inside a function
..
--- In flexcoders@yahoogroups.com, Paul Andrews [EMAIL PROTECTED] wrote:
- Original Message -
From: reflexactions [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, December 20, 2007 1:41 PM
Subject: [flexcoders] Re: const?
Thanks for the advice,
Maybe you could
unless you have a split personality.
Well... it might be you just provided the answer there. When working
on a project having the size of Flex, you work in a team.
Most probably a short function is indeed written by one person. But
what guarantees that nobody else will one day pass by and alter
- Original Message -
From: reflexactions [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, December 20, 2007 2:51 PM
Subject: [flexcoders] Re: const?
const are usually declared const becuase they are public or protected
and accesible by other user or subclass and you
I work in a team and have so done for the last 20+ years and never
yet declared a variable with function level scope as const just to
prevent some other person coming along later and changing the code
value of the variable if they think it is needed.
...and if thats was the case why dont we
be declared as a const
--- In flexcoders@yahoogroups.com, Paul Andrews [EMAIL PROTECTED] wrote:
- Original Message -
From: reflexactions [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, December 20, 2007 2:51 PM
Subject: [flexcoders] Re: const?
const are usually
- Original Message -
From: reflexactions [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, December 20, 2007 3:21 PM
Subject: [flexcoders] Re: const?
I work in a team and have so done for the last 20+ years and never
yet declared a variable with function level scope
- Original Message -
From: reflexactions [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, December 20, 2007 3:35 PM
Subject: [flexcoders] Re: const?
So your telling me that when you write a function if you have a var
that wont change its value for the duration
to code.
--- In flexcoders@yahoogroups.com, Paul Andrews [EMAIL PROTECTED] wrote:
- Original Message -
From: reflexactions [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, December 20, 2007 3:21 PM
Subject: [flexcoders] Re: const?
I work in a team and have so
: [flexcoders] Re: const?
So your telling me that when you write a function if you have a var
that wont change its value for the duration of that function say like:
override protected function updateDisplayList(...):void{
var count:int=numChildren;
..loop code..
...finished
}
I only
- Original Message -
From: reflexactions [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, December 20, 2007 4:13 PM
Subject: [flexcoders] Re: const?
20+ years? LOL, I have the drop on you..
Depends on how big the + is doesnt it lol...
Now if were gonna do a how long
Talking about ancient times - In Pascal you were able to declare local
member variables.
I always found it useful, if you need the var in one place only.
Cheers
Ralf.
: [flexcoders] Re: const?
I work in a team and have so done for the last 20+ years and never
yet declared a variable with function level scope as const just to
prevent some other person coming along later and changing the code
value of the variable if they think it is needed.
...and if thats
is the root of all evil.
--
Thanks,
Vadim.
- Original Message -
From: Ralf Bokelberg
To: flexcoders@yahoogroups.com
Sent: Thursday, December 20, 2007 6:18 PM
Subject: Re: [flexcoders] Re: const?
Ideally a const inside a function allows you to
use an identifier for a constant value, which
20 matches
Mail list logo