$CPU 8086 ' make compatible with XT systems $LIB ALL OFF ' turn off all PowerBASIC libraries $ERROR ALL ON ' 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) '/*------------------------------------------------------------------*/ ' A2BS(ARRAY$()) ' Array to Binary String. ' Returns a string containing the elements of ARRAY$(). ' You MUST put the number ARRARY$() elements into ARRAY$(0). ' You must make sure that the length of the returned string ' does NOT exceed the maxium string length setting. The Power ' BASIC default is 32,000. ' Each ARRAY$() element is separated by carriage-return and line- ' feed (CR/LF) pair. ' EXAMPLE: T$ = A2BS(ARRAY$()) ' ' $INCLUDE "C:\CODE\MLIB\MLIB.INC" ' DIM F$(250) ' F2A "C:\BATCH\NORMAL.BAT",F$() ' V$ = A2BS(F$()) ' BROWSE 31,V$,3,3,20,78 ' INPUT Z ' '/*------------------------------------------------------------------*/ $CODE SEG "MLIB4" '/*------------------------------------------------------------------*/ FUNCTION A2BS(X$()) PUBLIC AS STRING N = VAL(X$(0)) A$ = "" FOR CNT = 1 TO N A$ = A$ + X$(CNT) + CHR$(13) + CHR$(10) NEXT CNT A2BS = A$ END FUNCTION '/*------------------------------------------------------------------*/ ' $INCLUDE "C:\CODE\MLIB\MLIB.INC" ' DIM F$(250) ' F2A "C:\BATCH\NORMAL.BAT",F$() ' V$ = A2BS(F$()) ' BROWSE 31,V$,3,3,20,78 ' INPUT Z