$CPU 8086 ' make compatible with XT systems $LIB ALL OFF ' turn off all PowerBASIC libraries $ERROR ALL OFF ' turn off all PowerBASIC error checking $OPTIMIZE SIZE ' optimize for smaller code $COMPILE UNIT ' compile to a UNIT (.PBU) '$COMPILE EXE ' compile to a UNIT (.PBU) DEFINT A-Z ' Required for all numeric functions, forces PB to not ' include floating point in UNIT (makes it smaller) '/*------------------------------------------------------------------*/ $CODE SEG "MLIB5" '/*------------------------------------------------------------------*/ ' F2BS(FILESPEC) ' File to Binary String. ' Returns a string (including CR/LF) up to 32000 bytes in length ' from sequential file FILESPEC. ' EXAMPLE: T$ = F2BS("C:\AUTOEXEC.BAT") '/*------------------------------------------------------------------*/ FUNCTION F2BS(BYVAL FL AS STRING) PUBLIC AS STRING FFN = FREEFILE OPEN FL FOR BINARY AS #FFN IF LOF(FFN) > 32000 THEN GET$ FFN,32000,A$ ELSE GET$ FFN,LOF(FFN),A$ CLOSE #FFN F2BS = A$ END FUNCTION '/*------------------------------------------------------------------*/ ' CLS ' T$ = F2BS("C:\AUTOEXEC.BAT") ' PRINT T$ ' INPUT Z