本文提供一个卡拉OK字幕着色示例程序,其思路是利用FoxBASE+的求字串函数SUBSTR在显示的字符串中提取相应的字符进行动态着色,以模拟卡拉OK的字幕着色显示效果。程序在FoxBASE+2.10下通过。 SET TALK OFF SET STATUS OFF SET SCOREBOARD OFF ? SYS(2002) SET COLOR TO +7/1 CLEAR STRING='卡拉OK字幕着色动态显示” @12,24 SAY STRING SET COLOR TO 1/+7 L=LEN(STRING) I=1 DO WHILE I〈=L CH=SUBSTR(STRING,I,1) IF CH<>' ' @12,23+I SAY CH ?? CHR(7) J=0 DO WHILE J〈5000 J=J+1 ENDDO ENDIF I=I+1 ENDDO SET COLOR TO 7/0 CLEAR ?SYS(200,1) SET SCOREBOARD ON SET STATUS ON SET TALK ON
|