1 SUB Open_For_Update(INTEGER Lun,STRING Cfile,LONG Istatus)! ! ! This subroutine is used to open the data file specified by ! the string Cfile so that it may be updated. For use with ! Fortran, it is important to realize that an ONCE the file ! is opened by this BASIC subroutine, all file I/O must ! be done via the BASIC interface. ! ! CALL Open_for_Update(LUN, Cfile, Istatus) ! where ! LUN I*2 = Basic I/O Lun to use for file I/O ! ( not same as Fortran Lun) ! Cfile C*(*) = Filename (character string) ! Istatus I*2 = Open Status ! 1 = Success ! >1 Basic error code ! ! Written by: James G. Downward ! KMS Fusion, Inc. ! P.O. Box 1567 ! Ann Arbor, Mich. 48106 ! 10-Jan-1982 ! 10 %IDENT "1.1" MAP (Record_buf0) STRING In_Rec=512 ! Map for BASIC I/O ONERROR GOTO 1000 ! Catch open errors OPEN Cfile FOR INPUT AS FILE #LUN, ! Open file & ACCESS MODIFY, ! for modify & SEQUENTIAL VARIABLE, ! & MAP Record_buf0, ! & BUFFER 8 ! Do in 8 blk chunks Istatus=1 ! Show Success SUBEXIT ! Return 1000 Istatus=ERR ! Show open error !PRINT "VPW_Open_for_Update -- Error opening file: ";Cfile !PRINT " Error number = ";ERR !PRINT " Error message= ";ERT$(ERR) !SLEEP 4 RESUME 2000 ! Continue 2000 SUBEXIT ! 9999 SUBEND