First let me say Maverick is a great product even though it lacks documentation.
I'm having trouble with SELECT statements.
It seems the query makes no use of the dictionary entries to filter the results.
When executing the SELECT statement, the two records (in the sample code below) are returned.
What's wrong with my code ?
EXECUTE "CREATE.FILE FIC1"
OPEN "DICT","FIC1" TO DICTFIC1 ELSE DUMMY = FAIL("DICTFIC1")
* Write an entry to the dictionary
WDICT="A"
WDICT<2>=1
WDICT<3>="Libelle"
WDICT<9>="L"
WDICT<10>=10
WRITE WDICT ON DICTFIC1,"D1"
OPEN "FIC1" TO FIC1 ELSE DUMMY = FAIL("FIC1")
* Write 2 data records
WENR="ABC"
WENR<2>="123"
WRITE WENR ON FIC1,"1"
WENR="BAC"
WENR<2>="312"
WRITE WENR ON FIC1,"2"
EXECUTE 'SELECT FIC1 WITH A1="ABC"'
CL=0
10 READNEXT ID ELSE GO 20
READ WENR FROM FIC1,ID ELSE GO 10
CL+=1
GO 10
20 PRINT CL
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Perhaps I am just being dense (I don't have a Maverick installation right at the moment, so I can't say for certain), but it looks like a typo to me! In your execute statement, you have 'SELECT FIC1 WITH A1="ABC"', but you have called your dictionary entry 'D1'! Perhaps this is the problem?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
First let me say Maverick is a great product even though it lacks documentation.
I'm having trouble with SELECT statements.
It seems the query makes no use of the dictionary entries to filter the results.
When executing the SELECT statement, the two records (in the sample code below) are returned.
What's wrong with my code ?
EXECUTE "CREATE.FILE FIC1"
OPEN "DICT","FIC1" TO DICTFIC1 ELSE DUMMY = FAIL("DICTFIC1")
* Write an entry to the dictionary
WDICT="A"
WDICT<2>=1
WDICT<3>="Libelle"
WDICT<9>="L"
WDICT<10>=10
WRITE WDICT ON DICTFIC1,"D1"
OPEN "FIC1" TO FIC1 ELSE DUMMY = FAIL("FIC1")
* Write 2 data records
WENR="ABC"
WENR<2>="123"
WRITE WENR ON FIC1,"1"
WENR="BAC"
WENR<2>="312"
WRITE WENR ON FIC1,"2"
EXECUTE 'SELECT FIC1 WITH A1="ABC"'
CL=0
10 READNEXT ID ELSE GO 20
READ WENR FROM FIC1,ID ELSE GO 10
CL+=1
GO 10
20 PRINT CL
Perhaps I am just being dense (I don't have a Maverick installation right at the moment, so I can't say for certain), but it looks like a typo to me! In your execute statement, you have 'SELECT FIC1 WITH A1="ABC"', but you have called your dictionary entry 'D1'! Perhaps this is the problem?