title Module from library BASE_7 : FIXREC name ('FIXREC') maclib baselib.lib ; Change size of file with variable record length ; Copyright (C) Werner Cirsovius ; Hohe Weide 44 ; D-20253 Hamburg ; Tel.: +49-40-4223247 ; Version 1.0 December 1989 ; ENTRY Reg pair DE points to parameter block ; Byte 0 Record length (1 .. 255) ; Byte 1,2 Max record number (1 .. 65535) ; Byte 3,4 FCB of file ; Byte 5,6 Pointer to 128 byte buffer ; Byte 7,8 Pointer to record data ; Byte 9,10 Last record in old file ; EXIT Carry set on error, either disk or parameter error ; New empty (filled with blanks) file created ; if carry reset, file opened entry fixrec extrn $rndrg,$rndpr,inirec,$rnrec extrn open,create,filsiz,close,trncat fixrec: call $rndrg ; Get registers call $rndpr ; Test parameter ok ret c call open ; Test file here ret c push hl push de call filsiz ; Get size of file ex de,hl ld hl,($rnrec) ; Get new size or a sbc hl,de ; Compare jr c,trunc ; Truncate if new