$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) '/*------------------------------------------------------------------*/ DECLARE FUNCTION FILESPEC(BYVAL OPT AS STRING, BYVAL FSNAME AS STRING) AS STRING DECLARE FUNCTION XWORD(BYVAL W$,BYVAL WN, BYVAL SCHAR) AS STRING DECLARE FUNCTION XWORDS(BYVAL F$,BYVAL CHAR) AS INTEGER '/*------------------------------------------------------------------*/ $CODE SEG "MLIB6" '/*------------------------------------------------------------------*/ ' Creates file *.htm from f$.* ' Example: MKHTMLTBL "D:\DATA\UNION\ACTION\JUN01.CSV","skiblue","," '/*------------------------------------------------------------------*/ SUB MKHTMTBL(F$,BGCOLOR$,DELIM$) PUBLIC IF BGCOLOR$ = "" THEN BGCOLOR$ = "skiblue" IF DELIM$ = "" THEN DELIM = 44 ELSE DELIM = ASC(DELIM$) FS$ = FILESPEC("M",F$)+".HTM" FIN = FREEFILE OPEN"I",FIN,F$ FOUT = FREEFILE OPEN"O",FOUT,FS$ T2$ = "" PRINT#FOUT,T2$ WHILE NOT EOF(FIN) LINE INPUT#FIN,T$ NWRDS = XWORDS(T$,44) T2$ = "" FOR CNT = 1 TO NWRDS T2$ = T2$ +"" NEXT CNT T2$ = T2$ + "" PRINT#FOUT,T2$ WEND CLOSE#FIN T2$ = "
"+XWORD(T$,CNT,DELIM)+"
" PRINT#FOUT,T2$ CLOSE#FOUT END SUB '/*------------------------------------------------------------------*/ ' $INCLUDE "D:\CODE\MLIB\MLIB.INC" ' MKHTMLTBL "D:\DATA\UNION\ACTION\JUN01.CSV","skiblue","," ' y$ = getkey '/*------------------------------------------------------------------*/