xc-basic3 icon indicating copy to clipboard operation
xc-basic3 copied to clipboard

Wrong syntax accepted

Open neilsf opened this issue 2 years ago • 1 comments

Although it's invalid, the compiler does not complain about the following syntax:

DIM x, y AS LONG

One would assume that both x and y are defined as LONG, but this is not the case as x is defined as INT (because it is not followed by the AS keyword).

The correct syntax is

DIM x AS LONG, y AS LONG

The compiler should display an error in the first case.

neilsf avatar Sep 16 '23 10:09 neilsf

Actually, the behaviour is the same in QB (where the type defaults to SINGLE)... a warning may be sufficient.

neilsf avatar Sep 17 '23 08:09 neilsf