Posted by Robert G Laurin on May 01, 2012 at 11:45:49: Uploaded files: 4
I encountered this before, but this time I got to document it.
When compiling a program that INCLUDEs legacy USEFILES (aka CED source), if a ARRAY variable is RE-Declared using a SET number from the dot-IBS source, it generates an error.
In the demo program attached, the variable W$(TEN) is declared in the source and the usefile. This generates a compiler error "M04: Variable as been previously declared" (oops, there's a missing 'h' in 'has').
Something else, the source line of the error is showing TWICE (with option 'L').
One complaint I still have, in the compile listing it is difficult to locate actual errors. Between the warnings & errors it gets messy, worst so when the compile listing is in the many-many thousand lines range.
See attached for sources, below is compile listing of demo.
This was tested using Comet16 2011.459 and Rel 12.05
1 TEST-IB IBS 0000 ! //IB// Src(TEST-IB.IBS,TMP) Obj(TEST-IB,TMP) Opt(L)
2 TEST-IB IBS 0000
3 TEST-IB IBS 0000 !
4 TEST-IB IBS 0000 ! Test Demo program to Highlite Compiler Bug(s)
5 TEST-IB IBS 0000 !
6 TEST-IB IBS 0000
7 TEST-IB IBS 0000 SET TEN = 10
8 TEST-IB IBS 0000
9 TEST-IB IBS 0000 LENGTH 20 & LOCAL B$(TEN)
10 TEST-IB IBS 0000 LENGTH 20 & LOCAL W$(10)
11 TEST-IB IBS 0000 LENGTH 20 & LOCAL X$
12 TEST-IB IBS 0000
13 TEST-IB IBS 0000 INCLUDE '#IBTEST'
10000 #IBTEST 0000 !
10010 #IBTEST 0000 ! Demo INCLUDE File for Compiler Bug(s)
10020 #IBTEST 0000 !
10030 #IBTEST 0000 !
10040 #IBTEST 0000 SET NINE = 9
10050 #IBTEST 0000 !
10060 #IBTEST 0000 LENGTH 20 & LOCAL A$
10070 #IBTEST 0000 !
10080 #IBTEST 0000 LENGTH 20 & LOCAL B$(10)
* C:\DOCUME~1\RLAURIN\LOCALS~1\TEMP\CATEMP\#IBTEST (10080,24): warning ***** VARIABLE 'B$ ' HAS BEEN PREVIOUSLY DECLARED *****
10090 #IBTEST 0000 !
10100 #IBTEST 0000 LENGTH 20 & LOCAL W$(TEN)
10100 #IBTEST 0000 LENGTH 20 & LOCAL W$(TEN)
* #IBTEST(10100,24): error M04: Variable as been previously defined
10110 #IBTEST 0000 !
10120 #IBTEST 0000 LENGTH 20 & LOCAL X$
* C:\DOCUME~1\RLAURIN\LOCALS~1\TEMP\CATEMP\#IBTEST (10120,20): warning ***** VARIABLE 'X$ ' HAS BEEN PREVIOUSLY DECLARED *****
10130 #IBTEST 0000 !
10140 #IBTEST 0000 LENGTH 20 & LOCAL Y$(TEN)
10150 #IBTEST 0000 !
10160 #IBTEST 0000 LENGTH 20 & LOCAL Z$(NINE)
10170 #IBTEST 0000 !
14 TEST-IB IBS 0000
15 TEST-IB IBS 0000 !====================== Executables ==============
16 TEST-IB IBS 0000
17 TEST-IB IBS 0000 CLEAR
18 TEST-IB IBS 000A
19 TEST-IB IBS 000A
20 TEST-IB IBS 000A PRINT (0) W$(1) ! DO SOMETHING, ANYTHING
21 TEST-IB IBS 0012
22 TEST-IB IBS 0012
23 TEST-IB IBS 0012 RUN 'QMONITOR'
ZZZZZZZ TEST-IB IBS 0016 END
WARNING: Unreferenced Variable A$
WARNING: Unreferenced Array Y$
WARNING: Unreferenced Array Z$
Compilation Memory Usage
Available 00065057
Symbol Table 00000181
TOTAL ERRORS 00001
Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.