Hi all,
Just tested a simple function to check if the increments are done correctly.
I found the following a bit od.
Maybe some can shed a light on this..
base code:
//code
function test(myName:String,myNumber:Number):Void
{
trace(myName + " : " + myNumber);
}
var depth:Number = 1;
test('name' + depth, depth++); //traces name2 : 1
depth = 1;
test('name' + depth, ++depth); //traces name2 : 2
depth = 1;
test('name' + depth++, depth); //traces name1 : 1
depth = 1;
test('name' + ++depth, depth); //traces name2 : 1
//end code
I believe only the last 2 have the correct behavior, the first 2 don't.
when I test, test('name' + depth, depth++); I expect a trace like: name1 : 1
when I test, test('name' + depth, ++depth); I expect a trace like: name1 : 2
Is it my mind that's letting me down, or is it really a "bug" ?
Greetz,
Bernard
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com