If he really wanted, I think he could define the type to do the range checking.

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Paul 
Andrews
Sent: Monday, September 08, 2008 5:42 PM
To: [email protected]
Subject: Re: [flexcoders] function / method argument validation

----- Original Message -----
From: Alex Harui<mailto:[EMAIL PROTECTED]>
To: [email protected]<mailto:[email protected]>
Sent: Tuesday, September 09, 2008 1:21 AM
Subject: RE: [flexcoders] function / method argument validation

Instead of defining a function, you could define an interface

But it still wouldn't have a range check at compile time.

From: [email protected]<mailto:[email protected]> 
[mailto:[EMAIL PROTECTED] On Behalf Of Gordon Smith
Sent: Monday, September 08, 2008 3:10 PM
To: [email protected]<mailto:[email protected]>
Subject: RE: [flexcoders] function / method argument validation

No, AS3 doesn't support this.

Gordon Smith
Adobe Flex SDK Team

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of 
rss181919
Sent: Monday, September 08, 2008 11:47 AM
To: [email protected]
Subject: [flexcoders] function / method argument validation


Let's say I have the following call

s myvar = myfuntion (arg1:x)

Of course arg1 must be of type x or you get a compile time error. Is
there any way to force arg1 to be of a certain value range within type
x and have it checked at compile time?

For example, is there a way to create a group of constants or value
objects that the system would validate when compiling the function call?

Reply via email to