試圖讓自定義對話框使用按鈕名稱weapon1,weapon2和cancel。但與此代碼它給誤差上結果爲未定義當我嘗試編譯它 該錯誤消息自定義對話框
[DCC錯誤] ssClientHost.pas(760):E2003未說明的標識符「結果」
的代碼是:
with CreateMessageDialog('Pick What Weapon', mtConfirmation,mbYesNoCancel) do
try
TButton(FindComponent('Yes')).Caption := Weapon1;
TButton(FindComponent('No')).Caption := Weapon2;
Position := poScreenCenter;
Result := ShowModal;
finally
Free;
end;
if buttonSelected = mrYes then ShowMessage('Weapon 1 pressed');
if buttonSelected = mrAll then ShowMessage('Weapon 2 pressed');
if buttonSelected = mrCancel then ShowMessage('Cancel pressed');
'結果'未定義或'ShowModal'未定義? – 2012-07-20 19:06:29
[DCC錯誤] ssClientHost.pas(760):E2003未聲明的標識符:'結果' – 2012-07-20 19:07:16
然後,您不在功能中。結果是函數的結果,它在程序中沒有意義,所以它不可用。 – 2012-07-20 19:10:48