$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 "MLIB1" '/*------------------------------------------------------------------*/ ' BS2F STRING,FILESPEC ' Writes the contents of binary string STRING to file FILESPEC. ' If FILESPEC already exists, it is over-written. ' EXAMPLE: BS2F X$,"C:\TESTING.DAT" ' '/*------------------------------------------------------------------*/ SUB BS2F(BYVAL X AS STRING,BYVAL F AS STRING) PUBLIC FFN = FREEFILE L = LEN(X) OPEN F FOR BINARY AS #FFN PUT$ FFN, X CLOSE#FFN END SUB '/*------------------------------------------------------------------*/ ' CLS ' T$ = STRING$(400,")") ' BS2F T$,"C:\TESTING.DAT" ' SHELL "TYPE C:\TESTING.DAT" ' INPUT Z