Source language: Translate to:

Math Syntax

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Math Syntax

Postby ErgoMan » Thu Oct 12, 2006 4:27 pm

Hello,

I am trying to understand the syntax for mathematical expressions in NeoBook (using no plugins) and am confused. I tried several formulas and received errors when I followed the math convention for using parentheses and kept getting errors. Then I tried "breaking the rules" and was successful. Is there a reference that explains the syntax better than the help file and can explain why the following expressions worked (I got the correct results and NeoBook did not generate errors)?

Math "((3+5)*.2))*.2" "2" "[Result]"

Math "(((3+5)*.2))*.2))*.2" "2" "[Result]"

Thanks,

ErgoMan
ErgoMan
 
Posts: 50
Joined: Thu Jul 14, 2005 8:00 pm
Location: Bel Air, MD

Postby Neosoft Support » Thu Oct 12, 2006 5:55 pm

Generally, the number of left and right parentheses should be equal. Why the unbalenced parentheses works, I can't explain. Probably, what was originally causing the problem is not including a leading zero with your fractional numbers. For example, the following actions work without breaking the rules:

Math "((3+5)*0.2)*0.2" "2" "[Result1]"

Math "(((3+5)*0.2)*0.2)*0.2" "2" "[Result2]"
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby ErgoMan » Fri Oct 13, 2006 6:47 pm

NeoSoft Support,

Thanks for the reply. You are priceless! Your explanation helped but I think some of my problems were brought on by including an ampersand in some of the captions I was referencing. But, now I am able to use the syntax as you described and life is good.

ErgoMan
ErgoMan
 
Posts: 50
Joined: Thu Jul 14, 2005 8:00 pm
Location: Bel Air, MD


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 2 guests