2012-01-23 67 views
1

我試圖中止在ADA程序的任務,但我在編譯時出現此錯誤:中止聲明

expect task name or task interface class-wide object for "abort" 

的代碼看起來是這樣的:

task type Sending_Message; 
type Send_Message is access Sending_Message; 

declare 
    send : Send_Message; 
begin 
    send := new Sending_Message; 
    ... 
    abort send; -- this line throws error 
end; 

而當我再次嘗試線像這樣:

abort Sending_Message; 

我得到錯誤:

invalid use of subtype mark in expression or call 

任何想法是什麼錯?

回答

4

你必須明確地取消引用訪問類型:

abort send.all; 
+0

感謝,這是它:d – thim