The first error was that a variable, “UnitName” was not valid. At this point there was an indication of two errors. I changed the variable name and that problem was resolved. Then I got an err or in the following procedure:
procedure TForm_EditVetOrMem.DBGrid1TitleClick(Column: TColumn);
{$J+}
const PreviousColumnIndex : integer = 1;
{$J-}
begin
if DBGrid1.DataSource.DataSet is TCustomADODataSet
then
with TCustomADODataSet(DBGrid1.DataSource.DataSet) do
begin
if (Pos(Column.Field.FieldName, Sort) = 1)
and (Pos(' DESC', Sort)= 0) then
Sort := Column.Field.FieldName + ' DESC'
else
Sort := Column.Field.FieldName + ' ASC';
end;
end;
There were 7 errors identified with the following error message:
[DCC Error] EditVetOrMem.pas(212): Ambiguous overload lall to Pos
System.pas(25029): Related method: function Pos(const string;const string); Integer;
System.pas(25133): Related method: function Pos(const Widestring;const Widestring); Integer;
[DCC Warning] EditVetOrMem.pas(212): Impplicit string cast with potential data loss from ‘string’ to ‘ShortString’;