And seeing as I'm playing around with a p-code compiler ...

It's very simple for the compiler to do it that way. All the compiler
cares about is "is it a string or literal?". And if it's a literal, it
processes it as unquoted ascii text. So, as far as I'm concerned, as it
comes from the lexer into the parser I have already lost the distinction
between '1' and '"1"', and can't tell them apart...

Cheers,
Wol

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Simon Lewington
Sent: 01 April 2004 09:32
To: [EMAIL PROTECTED]
Subject: Re: Data typing in MV Basic

"Anthony Youngman"...

> 'A = 1' and 'A = "1"' both result in IDENTICAL p-code.

This is certainly how the UD compiler works.

I say its a bug, because  'A="1.1"' and 'A="1,1"' *don't* result in the
same
p-code - and it doesn't just differ by the comma - one is stored as a
string
the other as a number.

This then causes problems running with 'SET.DEC ,' (which changes the
decimal separator to a comma) since the "1.1" which was meant to be a
literal gets changed to "1,1", eg...

VERSION="1.1"
READ VERSION.INFO FROM VFP,VERSION ELSE VERSION.INFO=''

The version file is keyed on strings which happen to be numbers.  The
version code is hard-coded into a program as a string - ie it has qoutes
round it.  With 'SET.DEC ,' to please some Europeans, the s/w converts
VERSION to "1,1" before doing the read since it is a number not a string
-
and so fails to read the item. I'd want this to happen with
'VERSION=1.1'
which is specifying a number.  As with everything, this can be worked
around,  but what a pita.

Simon



-- 
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users




****************************************************************************

This transmission is intended for the named recipient only. It may contain private and 
confidential information. If this has come to you in error you must not act on 
anything disclosed in it, nor must you copy it, modify it, disseminate it in any way, 
or show it to anyone. Please e-mail the sender to inform us of the transmission error 
or telephone ECA International immediately and delete the e-mail from your information 
system.

Telephone numbers for ECA International offices are: Sydney +61 (0)2 9911 7799, Hong 
Kong + 852 2121 2388, London +44 (0)20 7351 5000 and New York +1 212 582 2333.

****************************************************************************

--
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to