$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 "MLIB4" '/*------------------------------------------------------------------*/ ' AHEAD(S$,OPT$,PN) ' Add Header to string. ' Adds Header to S$ using options in OPT$ and optional page number PN. ' OPT$: D = Adds Power Basic DATE$ to S$. ' T = Adds Power Basic TIME$ to S$. ' P = Adds page numbers to S$. ' Example: H$ = "Page # of 10" ' T$ = AHEAD(H$,"D T P",1) 'Page 1 of 10 09-14-1998 14:31:09' ' T$ = AHEAD(H$,"D T P",3) 'Page 3 of 10 09-14-1998 14:33:09' ' '/*------------------------------------------------------------------*/ FUNCTION AHEAD(S$,OPT$,PN) PUBLIC AS STRING OPT$ = UCASE$(OPT$) S$ = TRIM$(S$) D = INSTR(1,OPT$,"D") T = INSTR(1,OPT$,"T") P = INSTR(1,OPT$,"P") IF D > 0 THEN S$ = S$ + " " + DATE$ IF T > 0 THEN S$ = S$ + " " + TIME$ IF P > 0 THEN S = INSTR(1,S$,"#") L$ = LEFT$(S$,S-1) R$ = RIGHT$(S$,LEN(S$)-S) S$ = L$ + TRIM$(STR$(PN)) + R$ END IF FUNCTION = S$ END FUNCTION '/*------------------------------------------------------------------*/ ' $INCLUDE "C:\CODE\MLIB\MLIB.INC" ' T$ = "Green Valley Ward -- Page # of 2" ' T$ = AHEAD(T$,"D T P",1) ' SAY 20,1,T$,31 ' Y$ = GETKEY '/*------------------------------------------------------------------*/