Why doesn't CONST like ATN?
Author Message
Why doesn't CONST like ATN?

I've tried to enter a formula for pi as a constant using a formula for
inverse sine I found in my old GWB manual (ARCSIN(X)=ATN(X/SQR(-X*X+1)),
but when I try to use this formula in a constant, it gives me "Invalid
constant". It works fine as a variable, so what's wrong?
(I use .5 for X and multiply the result by 2)
--
Cogito Ergo Um - I think therefore I .. er ...

Thu, 30 Nov 2000 03:00:00 GMT
Why doesn't CONST like ATN?

Quote:

>I've tried to enter a formula for pi as a constant using a formula for
>inverse sine I found in my old GWB manual (ARCSIN(X)=ATN(X/SQR(-X*X+1)),
>but when I try to use this formula in a constant, it gives me "Invalid
>constant". It works fine as a variable, so what's wrong?
>(I use .5 for X and multiply the result by 2)

Check out the last sentence in this snip from the QB 4.5 help on CONST.

CONST Statement Details

Syntax
CONST constantname = expression [,constantname = expression]...

Argument       Description
constantname   A name following the same rules as a BASIC variable
name. You may add to the name a type-declaration
character (%, &, !, #, or \$) to indicate its type,
but this character is not part of the name.

expression     An expression consisting of literals (such as 1.0),
other constants, or any of the arithmetic and
logical operators except exponentiation (^). You may
also use a single literal string such as "Error on
input". You cannot use string concatenation,
variables, user-defined functions, or intrinsic
functions like SIN or CHR\$ in expressions assigned
to constants.
--
Judson McClendon          This is a faithful saying and worthy of all
Sun Valley Systems        acceptance, that Christ Jesus came into the

(please remove numbers from email id to respond)

Thu, 30 Nov 2000 03:00:00 GMT

 Page 1 of 1 [ 2 post ]

Relevant Pages