- 好友
- 0
- 帖子
- 124731
- 積分
- 124889
- 最後登錄
- 2019-2-28
- 在線時間
- 0 小時
- 好友
- 0
- 帖子
- 124731
- 積分
- 124889
- 最後登錄
- 2019-2-28
- 在線時間
- 0 小時
|
procedure TForm1.FormCreate(Sender: TObject);
function StringToCaseSelect
(Selector : String;
CaseList : Array of String) : Integer;
var cnt : Integer;
begin
Result := -1;
for cnt := 0 to Length(CaseList) -1 do
begin
if CompareText(Selector, CaseList[cnt]) = 0 then
begin
Result := cnt;
Break;
end;
end;
end;
{
Usage:
case StringToCaseSelect('Delphi',
['About','Borland','Delphi']) of
0:ShowMessage('Youve picked About');
1:ShowMessage('Youve picked Borland');
2:ShowMessage('Youve picked Delphi');
end;
}
end.
问题显示:BEGIN expected but END found 和 Declaration expected but end of file found
==========================================================
[ 本帖最後由 1910X3 於 2010-05-08 09:30 AM 編輯 ] |
|