用cdBASE实现下拉式菜单 河南 张克友 1994-01-07 SET TALK OFF SET COLOR ON SET DEVICE TO SCREEN X=“1.维护2.输入3.修改4.查询5.分析6.打印7.自检8.退出” N=1 DO WHILE N<=8 F="X"+STR(N,1,0) &F=SUBSTR(X,N*6-5,6) N=N+1 ENDDO L11=" " L12=" " L1=L11+L12 L21=" " L22=" " L2=L21+L22 SET COLO TO 7/0 CLEAR SET COLO TO 6/1 @ 3,2 SAY L1 @ 4,2 SAY "|"+SPACE(72)+"|" @ 5,2 SAY L2 SET COLO TO 1/2 N=1 DO WHILE N<=8 F="X"+STR(N,1,0) @ 4,9*N-5 SAY" "+&F+" " N=N+1 ENDDO N=1 M=1 SET COLO TO 3/4 F="X"+STR(N,1,0) @ 4.9*(N-1)+4 SAY" "+&F+" " DO WHILE .T. @ 4,(N-1)*9+6 SAY" " DO WHILE .T. SET CONS OFF WAIT" "TO P P1=PEEK(PEEK(1050)+1023) SET CONS ON DO CASE CASE P1=77 M=N+1 CASE P1=75 M=N-1 CASE P1=28 EXIT OTHERWISE LOOP ENDCASE IF M=9 M=8 ENDIF IF M=0 M=1 ENDIF SET COLO TO 1/2 F="X"+STR(N,1,0) @ 4,(N-1)*9+4 SAY" "+&F+" " N=M SET COLO TO 3/4 F="X"+STR(N,1,0) @ 4,(N-1)*9+4 SAY" "+&F+" " @ 4,(N-1)*9+6 SAY" " ENDDO SET COLO TO 7/0 IF N=8 QUIT ENDIF ENDDO RETURN 河南 张克友