Think of something that you wish Authorware could do but it doesn't? Let the our good friends at Macromedia know via the wishlist. Please let us know if you find any of the materials on this site inappropriate or offensive. Please include the url and why the material should be reviewed. Comments and questions about the site are also welcome. Please no Authorware questions, use the AWARE list. |
Back
B7010 - How do I get the Max function to return the real value? by - Joseph Ganci Interesting problem.
The definition for max() gives no indication that it only works with integers.
Ah, well, whenever I find an apparent bug, I try to find a workaround. Assuming that
your numbers are limited to two decimal places (as with dollars and cents,
the following code should give you a clue as to how to accomplish what you
need to do: list := [23.24,
5643.22, 3.89] The first list
contains three numbers. List2 is a copy of list so you can manipulate it.
Every value in the list is multiplied by 100 to make it an integer. The variable
max then finds the maximum value and divides it by 100 to get it back to the
original value. If your decimal value can be longer than 2 digits, you will
have to manipulate the 100 value above to accommodate the lowest significant
digit. |