'=========================================================================== ' Subject: HILIGHT PRINT Date: 12-05-96 (18:19) ' Author: Andrew Diamond Code: QB, QBasic, PDS ' Origin: albertad@geocities.com Packet: GRAPHICS.ABC '=========================================================================== 'Program Type -- Modified Print 'Programmer: Andrew Diamond 'Web Page: http://www.geocities.com/SiliconValley/Heights/3128/QBASIC.HTM 'Date: 12/5/96 ' ' Overview: Use this subroutine to highlight certain characters without ' having to LOCATE, PRINT a bunch of times. ' ' Usage: ' selection column, row, text$, highlight$, TextColor, HighLighter ' ' DECLARE SUB selection (x%, Y%, text$, highlight$, TextColor%, HighLighter%) DEFINT A-Z ' You don't have to, but why not? SCREEN 13 ' Wider variety of colors selection 5, 10, "Press Y to quit.", "Y", 8, 15 DO UNTIL UCASE$(INKEY$) = "Y": LOOP ' Wait for Y selection 5, 10, "Now Press to quit.", "P", 8, 15 DO UNTIL UCASE$(INKEY$) = "P": LOOP ' Wait for Y ' ' This subroutine searches through text$ for the letter designated ' in highlight$. When it finds it, it prints it the color HighLigher. ' If the subroutine doesn't find the letter, it prints it directly at ' the end of text$. ' SUB selection (x, Y, text$, highlight$, TextColor, HighLighter) LOCATE x, Y COLOR TextColor PRINT text$; FOR I = 1 TO LEN(text$) IF MID$(text$, I, 1) = highlight$ THEN dummy = I: EXIT FOR NEXT I COLOR HighLighter LOCATE x, (Y - 1) + I: PRINT highlight$; END SUB