Using KSAM/XL and KSAM 64 (32650-90886)

Appendix B 257
BASIC/V Intrinsics
BKSTART
100 DIM A$(10),S$(4)
150 A$=" " <-------------------
assign null string to keyvalue
160 L=21 <--------------------
assign alternate key location to keylocation
170 CALL BKSTART(F,S$,A$,21)
The default for
relation
is 2 (greater than or equal to) and need not be specified except for
documentation purposes.
Figure B-10. illustrates the use of BKSTART with default values for all optional parameters.
Specified in this minimal form, it positions to the least valued primary key.
Figure B-10. Positioning Pointer to Least-Valued Record with BKSTART
1080 REM *******************************************************
1090 REM * POSITION TO LEAST VALUED PRIMARY KEY *
1100 REM *******************************************************
1110 REM
1120 REM F IS THE FILE NUMBER OF A KSAM FILE
1130 REM OPENED BY A CALL TO BKOPEN
1140 REM
1150 CALL BKSTART(F,S$)
1160 REM
1170 REM NOW DETERMINE WHETHER THIS CALL HAS SUCCEEDED
1180 REM
1190 IF S$[1;1]<>"0" THEN DO
1200 REM N$ CONTAINS THE NAME OF THE KSAM FILE
1210 REM S$ CONTAINS THE STATUS CODE RETURNED BY THE PRECEDING CALL
1220 PRINT "UNABLE TO POSITION FILE TO LEAST VALUED PRIMARY KEY"
1230 PRINT "ERROR ";S$[1;1]," DETAIL";S$[2]
1240 CALL BKERROR,(S$,M$)
1250 PRINT M$
1260 GOTO 3620
1270 DOEND
1280 REM
1290 REM THE PROGRAM CONTINUES
1300 REM