' *** SPEC_CHR.LST *** 2nd GFA-Manual, page 8-12 > PROCEDURE special_characters(x0,y0,VAR choice) ' ' *** Put special characters (ASCII-code >127) on screen ' *** Choose special character by entering the code or by clicking with mouse ' *** Code must consist of three digits (128-255) ' *** If user clicks outside table or enters 0, choice&=0 (no choice) ' *** For High resolution only ' ' *** Standard: x.max& y.max& ' *** Global: special.char.box$ [the table of the special characters] ' LOCAL dx,dy,x1,y1,x2,y2,code,x,y,line,column,ok!,xm,ym,col.m,lin.m,k$,code$,m$ WHILE MOUSEK WEND ! mouse released? {ADD(XBIOS(14,1),6)}=0 ! clear keyboard-buffer dx=21 ! horizontal tabs # 20 # dy=32 ! vertical tabs x1=x0 y1=y0 x2=x1+16*dx+dx/4 y2=y1+9*dy-dy/4 IF x2>x.max ! too far to the right x1=x.max-(16*dx+dx/4) x2=x.max ENDIF IF y2>y.max ! too far down y1=y.max-(9*dy-dy/4) y2=y.max ENDIF GET x1,y1,x2,y2,table$ ! save screen-part ' IF special.char.box$="" ! first time? DEFFILL 0,0 PBOX x1,y1,x2,y2 code=128 ! first code DEFTEXT 1,0,0,13 ! 8x16 font x=x1+dx/2 y=y1+dy/2 FOR line=1 TO 8 FOR column=1 TO 16 TEXT x,y,CHR$(code) ! the characters ADD x,dx INC code NEXT column x=x1+dx/2 ADD y,dy NEXT line code=128 ! first code DEFTEXT ,,,4 ! 6x6 font x=x1+dx/4 y=y1+dy-dy/8 FOR line=1 TO 8 FOR column=1 TO 16 TEXT x,y,STR$(code) ! the codes ADD x,dx INC code NEXT column x=x1+dx/4 ADD y,dy NEXT line BOX x1,y1,x2,y2 LINE x1,y1+8*dy,x2,y1+8*dy DEFTEXT ,2,,13 m$="Click on character or enter 3-digit code" TEXT x1+dx/4,y2-dy/4,-(x2-x1-dx/2),m$ GET x1,y1,x2,y2,special.char.box$ ELSE PUT x1,y1,special.char.box$ ! we already have the table ENDIF ' SHOWM REPEAT k$=INKEY$ code$=code$+k$ IF LEN(code$) AND VAL(code$)=0 ! user entered 0 ok!=TRUE choice=0 ! no choice ENDIF IF LEN(code$)=3 choice=VAL(code$) IF choice>=128 AND choice<=255 ! valid ASCII-character ok!=TRUE ELSE ! invalid ASCII-character OUT 2,7 ! bell PAUSE 5 SHOWM code$="" ! start again ENDIF ENDIF IF MOUSEK=1 ! click on a character? xm=MOUSEX ym=MOUSEY IF xm>x1 AND xmy1 AND ym