Flash CS3 Professional: unformatted code

I guess I wonder why Adobe with a list of bugs growing!?. The bug I found, in CS3 Professional in Italian, is very troublesome and dangerous. Eye to the following code:

1
2
3
getRandRange ( min : uint , max : uint ) : uint { private function getRandRange (min: uint , max: uint ): uint {
uint ( Math . floor ( Math . random ( ) * ( max - min + 1 ) ) + min ) ) ; return ( uint ( Math . floor ( Math . random () * (max - min + 1)) + min));
}

After the automatic formatting:

1
2
3
getRandRange ( min : uint , max : uint ) : uint { private function getRandRange (min: uint , max: uint ): uint {
( Math . floor ( Math . random ( ) * max - min + 1 ) + min ) ; return uint ( Math . floor ( Math . random () * max - min + 1) + min);
}

He removed the brackets in the calculation max-min+1 ! That, of course, no longer returns the correct value! . The parenthesis, in fact, it is vital since it allows to multiply Math.random() for the entire result of the expression (max-min+1) . e poi, al risultato di questa moltiplicazione, viene sottratto (min+1) !! In the second case, after the code was "sformattato", Math.random() is multiplied "only" to the max and then, the result of this multiplication is subtracted (min+1) ! I explained that only needs to be complete ... but I think it was clear to everyone ...

Evidently the house Adobe really think that mathematics is an opinion!?
This is a bug of dangerous if the formatting codes bodied ... "upsets" the code, it becomes a serious problem going to put everything back in place! I hope that Adobe may provide a patch soon! So WARNING! Let me know if it does to you, to your version ...

2 comments to "Flash CS3 Professional: the code is not formatted"

  1. March 3, 2008 Cristian :

    I do not like the little button of autoformat for other reasons ... and discover this BUG I definitely close to automatic. Thank you.

  2. March 3, 2008 Giovambattista Fazioli :

    @ Cristian: I agree with you! Too bad because given the poor usability of the editor of Flash could make up the formatting ... I really hope that will solve the problem in future patches.

Leave a comment

TAG XHTML PERMITS: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERTION CODE:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL 


Stop SOPA