function TDragForm.AddNotDup (List: TCustomListBox; Text: string): Boolean;begin // 判断项目是否存在 Result := List.Items.IndexOf (Text) < 0; if Result then List.Items.Add (Text);end;
从函数中能看出来这个result应该是返回的值
但是在我照着写的时候确报错 function tdragform.addnotdup(list:TCustomListBox;text:string):Boolean; begin Result:=list. end;写到这里报错 [Pascal Error] Unit1.pas(1): Unable to invoke Code Completion due to errors in source code