1 SUB Update_Record(INTEGER Lun, & STRING Input_Record, & INTEGER Character_Count, & LONG Istatus) ! ! This subroutine updates the sequential record currently pointed ! to by the last Get_Record call in the file opened by ! Open_for_Update on LUN. Required input is the record string ! and the number of characters in the record read by Get_Record ! The length of a record for update must be identical with ! the record initially read in. All I/O to the file opened by ! Open_for_Update must be done via the BASIC I/O system. ! ! CALL Update_Record(LUN, Input_Record, Character_count, Istatus) ! Where: ! LUN I*2 BASIC LUN for I/O ! Input_Record C*512 The input record. ! Character_count I*2 The number of characters returned ! Istatus I*4 Error status. ! =1 Success ! >1 BASIC error code ! ! Written by: ! James G. Downward ! KMS Fusion, Inc. ! PO, Box 1567 ! Ann Arbor, Mich. 48106 ! 10-Jan-1982 ! 10 %IDENT "1" ! MAP (Record_buf0) STRING In_Rec=512 ! File I/O data buffer ONERROR GOTO 1000 ! Trap update errors In_Rec=Input_Record ! Set data in buffer MOVE TO #LUN,In_Rec=512 ! and in RMS buffer UPDATE #LUN,COUNT Character_Count ! Update the record Istatus=1 ! Show success SUBEXIT ! Done 1000 Istatus=ERR ! Show open error PRINT "VPW_Update_Record -- Error updating record" PRINT " BASIC Error #";ERR PRINT " BASIC error message: ";ERT$(ERR) SLEEP 4 ! Give time to view RESUME 2000 ! 2000 SUBEXIT ! 9999 SUBEND