OWBasic for Pocketviewer

Home INTRO Group FILE Alphabetical Index

Example for Access to File with Filepointers

In this example all memos in one category are read and the title line is printed.


	INPUT "Which category: ",cat
	fp=-1:	            ! Set filepointer for "first search"
$loop:	FILENEXT 3,cat,fp:  ! Get pointer to next record
	IF fp=-1 GOTO ready:! No further record
	FILEREAD 3,cat,fp:  ! Read memo to FILEBUFFER
	FOR i=0 TO 20:      ! First 21 characters
	IF FILEBUFFER[i]=13 GOTO next
			    ! End Of Line?
	PRINT CHR$(FILEBUFFER[i]);
			    ! Print character
	NEXT
$next:	PRINT:              ! New Line
	GOTO loop
$ready:	PRINT "Ready"


  • FILE - Access to Files with Filepointer
  • FILEBUFFER - Internal file buffer
Home INTRO Group FILE Alphabetical Index