Page 1 of 1

Getting old RichView Delphi5 project to compile on D2010 ?

Posted: Wed Mar 24, 2010 9:11 pm
by Nostradamus
When I run compile in D2010 the project breaks at this line of code...

while (Offs>0) and rve.RVData.IsDelimiterW(Word(ws[Offs])) do begin

message line 1899
[DCC Error] MainFrame2.pas(1899): E2010 Incompatible types: 'Char' and 'Word'

Any help is appreciated.....

from the procedure shown below...
++++++++++++++++++++++++++++++++++++++++++


{=========================== Word Selection ===================================}

{ Selecting previous word in the ItemNo-th item of rve. Offs - caret position.
Moved - if the caret was already moved }
function SelectPrevWordInItem(rve: TCustomRichViewEdit; ItemNo, Offs: Integer;
Moved: Boolean): Boolean;
var ws: WideString;
WordEndOffs: Integer;
begin
Result := False;
if rve.GetItemStyle(ItemNo)<0 then
exit;
ws := rve.GetItemTextW(ItemNo);
dec(Offs);
// skipping delimiters
while (Offs>0) and rve.RVData.IsDelimiterW(Word(ws[Offs])) do begin
dec(Offs);
Moved := True;
end;
if Offs=0 then
exit;
// if the caret was not moved, skipping the current word and delimiters before it
if not Moved then begin
while (Offs>0) and not rve.RVData.IsDelimiterW(Word(ws[Offs])) do
dec(Offs);
if Offs=0 then
exit;
while (Offs>0) and rve.RVData.IsDelimiterW(Word(ws[Offs])) do
dec(Offs);
if Offs=0 then
exit;
end;
// we are at the end of word, finding its beginning
WordEndOffs := Offs;
while (Offs>0) and not rve.RVData.IsDelimiterW(Word(ws[Offs])) do
dec(Offs);
rve.SetSelectionBounds(ItemNo, Offs+1, ItemNo, WordEndOffs+1);
rve.Invalidate;
Result := True;
end;

Posted: Thu Mar 25, 2010 10:38 am
by Sergey Tkachenko
Remove "Word", change:
rve.RVData.IsDelimiterW(Word(ws[Offs]))
to
rve.RVData.IsDelimiterW(ws[Offs])