I feel we may be in agreement here but I'm not sure.

A = 1 assigns a numeric integer. The expression need not contain operators
(+,-,etc) to be numeric.
A = "1" assigns a string however, as you have explicitly declared it to be
A = "1" + 2 assigns a numeric integer value (3) as the result is numeric.
A = "one" + 2 assigns a zero - according to the error message.

For the benefit of those watching on the side-lines...

This is why a dimensioned array should (if possible) be used where
accumulations are concerned as the elements of dimensioned arrays are
individual variables and as such can by typed numeric to speed the
mathematics whereas dynamic arrays in this situation are always storing the
data as a string so conversions are carried out before and after each
mathematical accumulation.

Hope this has been of interest to some.


Trevor Ockenden
Open Systems Professionals

----- Original Message ----- 
From: "Results" <[EMAIL PROTECTED]>
To: "U2 Users Discussion List" <[EMAIL PROTECTED]>
Sent: Wednesday, March 31, 2004 10:34 AM
Subject: Re: Modern Universe - was: The lists are closing

> Trevor,
>     I *think* the issue is that the mv runtime does typecast variables
> on the fly, transparently. Which means that assigning a number or the
> result of a numeric expression (AVAR = 1 * 3) results in AVAR becoming
> an Integer variable. If you then say something 'string-ish'  (AVAR =
> "The answer is " : AVAR)  then the variable is recast on the fly into a
> String variable.
>     - Charles "Constant" Barouch
> Trevor Ockenden wrote:
> >Thank you Will but I consider "A = 1" to be an assignment of the number 1
> >being the result of expression "1" which in my books is numeric.
> >
> >To clarify this point for others...
> >
> >"anything on the right hand side of an assignment symbol (in this case
> >is an expression"
> >
> >Cheers
> >
> >Trevor Ockenden
> >OSP

Outgoing mail is certified Virus Free by AVG 6.0.
Checked by AVG anti-virus system (
Version: 6.0.642 / Virus Database: 410 - Release Date: 25/03/2004

u2-users mailing list

Reply via email to