AREV 3.12 cursors and their use (AREV Specific)
At 02 JUL 2001 12:51:41PM Daniel Rebich wrote:
I am attempting to 'set' a cursor via 'SELECT…BY' in an AREV 3.12 program. The syntax is as follows:
PERFORM "SELECT file_var WITH X=' AND WITH Y NE '' BY field.1 BY field.2 SETTING CURSOR.NO"
I am receiving an unrecognized 'SETTING is an unrecognized keyword' error. Any suggestions as to what the problem is?
Thank You
Daniel Rebich
At 02 JUL 2001 01:49PM Don Miller - C3 Inc. wrote:
Daniel ..
You don't use the PERFORM statement. You do an R/BASIC Select:
SELECT filespec BY SortList SETTING CURSORNO ELSE …
Note that if you aren't using SortList you must specify a null (either "" or a null variable)
Don Miller
C3 Inc.
At 02 JUL 2001 02:39PM Daniel Rebich wrote:
Don,
The program won't even compile w/o the "PERFORM". Is there a system library that needs to be included at the beginning of the program to allow the R/BASIC SELECT to compile w/o the "PERFORM"?
Thanks
Daniel
At 03 JUL 2001 09:07AM Don Miller - C3 Inc. wrote:
Daniel ..
Here's a sample program from the AREV Doc which I compiled and tested previously:
THIS USES THE CUSTOMER FILE PROVIDED IN AREV 3.X
DECLARE SUBROUTINE MSG,FSMSG
SORT_LIST=ZIP":@FM:"COMPANY"
SELECT "CUSTOMER" BY SORT_LIST SETTING CURSOR ELSE
FSMSG()STOPEND
* NOW A LITTLE TESTING
OPEN "CUSTOMER" TO CUSTOMER ELSE
FSMSG()STOPEND
CC=0
L0:
READNEXT @ID THEN
READ @RECORD FROM CUSTOMER,@ID THENCC+=1
DO SOME DISPLAY OR WHATEVEREND ELSE
HANDLE THE READ ERRORENDGOTO L0END ELSE
END OF FILEMSG("READ ":CC:" RECORDS FROM CUSTOMER")END
If you have a copy of the Documentation for AREV 3.x, check out pages 293-297 and the material on REDUCE on pages 388-393. Note that the use of SELECT BY precludes any filtering allowed by PERFORM SELECT statements. That is why REDUCE is available.
Hope this helps
Don Miller
C3 Inc.