1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43:
| procedure tmainform.ReserviertBold(key: char); var x,y,a, i,j,match, selstart, sellength:integer; w1,w2,w3,hlp:string; c_zeichen:tcursor; begin SelStart := Editor.SelStart; SelLength := Editor.SelLength;
x:=editor.caretpos.x; y:=editor.caretpos.y; w2:=editor.lines[y]+key; a:=length(w2); if (x>0) and (key=' ') then begin c_zeichen:=editor.cursor; w1:=''; j:=0; for i:=1 to a do begin if ((w2[i]<>' ') and (w2[i]<>'(')) then begin w1:=w1+w2[i]; end else begin match:=findfromliste(liste,laenge,w1); editor.SelStart:=j; editor.SelLength:=length(w1);
if (match>=0) then begin if ord(key)=40 then editor.SelAttributes.Color:=funktionfarbe else editor.SelAttributes.Color:=liste[match+1].tokencolor;
end else editor.SelAttributes.Color:=clblack; j:=j+length(w1)+1; w1:='';
memo1.Text:=inttostr(editor.selstart)+memo1.text+'j'; end; editor.SelStart := SelStart; editor.SelLength := SelLength; end;
end; end; |