$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" '/*------------------------------------------------------------------*/ ' F2A FILESPEC, ARRAY$() ' File to Array. ' Loads the contents of disk file FILESPEC into ARRAY$(). ' The number of elements is placed into ARRAY$(0) ' Be sure to properly dimension ARRAY$(). ' EXAMPLE: F2A "C:\BATCH\NORMAL.BAT", D$() '/*------------------------------------------------------------------*/ SUB F2A(BYVAL F AS STRING, D$()) PUBLIC FFN = FREEFILE OPEN "I",FFN,F CNT = 0 DO CNT = CNT + 1 LINE INPUT#FFN, D$(CNT) LOOP WHILE NOT EOF(FFN) CLOSE#FFN D$(0) = STR$(CNT) END SUB '/*------------------------------------------------------------------*/ ' DIM D$(250) ' CLS ' F2A "C:\batch\normal.BAT", D$() ' N = VAL(D$(0)) ' FOR CNT = 1 TO N ' PRINT D$(CNT) ' NEXT CNT ' INPUT Z