$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 SPACE(BYVAL X AS STRING, BYVAL N AS INTEGER, BYVAL PAD AS STRING) AS STRING $CODE SEG "MLIB11" '/*------------------------------------------------------------------*/ FUNCTION PROPER(BYVAL A AS STRING) PUBLIC AS STRING T$ = LCASE$(LTRIM$(RTRIM$(A))) T$ = SPACE(T$,1," ") MID$(T$,1,1) = UCASE$(MID$(T$,1,1)) SP = 1 DO S = INSTR(SP,T$," ") IF S = 0 THEN EXIT LOOP IF S > 0 THEN MID$(T$,S+1,1) = UCASE$(MID$(T$,S+1,1)) SP = SP + 1 END IF LOOP FUNCTION = T$ END FUNCTION '/*------------------------------------------------------------------*/ ' $INCLUDE "C:\CODE\MLIB\MLIB.INC" ' A$ = " mentor sometimes this is wokring this is fun!" ' PRINT A$ ' PRINT PROPER(A$) ' Y$ = GETKEY