Supported Mathematical Operators in WordBasicLast reviewed: July 30, 1997Article ID: Q74050 |
The information in this article applies to:
SUMMARYExponential calculations do not have a supported mathematical operator in WordBasic. The following table indicates the mathematical operators that are supported using Microsoft WordBasic:
Operator Operation Performed -------- ------------------- () Changes precedence; performs the operation inside the parentheses first - Negative value * Multiply / Divide Mod Round both numbers to integers, divide, and return the remainder + Add - SubtractExamples:
total = (23 - 1)/2 x = (6 * 3) + 2 MORE INFORMATIONTo perform a mathematical calculation that involves exponents, you must use the UtilCalculate() function. This functions returns a value to a numeric variable. For example, in version 1.x of Word for Windows, to find out what 2 to the eighth power (2^8) is, you need the following WordBasic statement:
x = UtilCalculate("2^8")In version 2.0 of Word for Windows, you need the following WordBasic statement:
x=ToolsCalculate("2^8")For more information on calculations with exponents, query on:
Exponent and REFERENCES"Microsoft Word for Windows and OS/2 Technical Reference," page 28 "Microsoft WordBASIC Primer," page 176 Kbcategory: kbusage kbmacro KBSubcategory: |
Additional query words: winword2 6.0 6.0a 6.0c 1.x 2.0 word6
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |