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

B8006 - I'm confused when comparing strings and numbers. Can you help?

by - Joseph Ganci


I stripped my var "a"

b:=Strip("VOI", a)

and the end result is b="D" with tells me it was a string...


Actually, any string that doesn't contain numbers will equate to a 0 if you're evaluating it as a number. For instance, if you have the following equations:

string := "hello"
a := 1 + string

the result will be that a = 1

if you have

string := "h2ello4"
a := 1 + string

then a = 25

Huh? Sure, Authorware strips out any non-numerical characters, so it evaluates string as 24. Therefore a = 1 + 24 = 25

This sometimes confuses people so it's good to know the rule.

There are 0 reviews
Add your review
Back