我正在Ada中爲數據結構和算法類做一個程序。Ada實際的這個必須是一個變量在輸出模式
我現在的問題是錯誤「實際爲‘這’必須是一個變量」 我做了一些環顧四周,我讀到它了模式是因爲,但我不能完全把握我猜爲什麼它發生在我身上。
我看過的例子很有意義,但我猜是因爲這是我的編碼我只是沒有看到它?
Procedure AddUnmarked(g:Grid; this:Linked_List_Coord.List_Type; c:Cell) is
cNorth : Cell := getCell(g, North(c));
cEast : Cell := getCell(g, East(c));
cSouth : Cell := getCell(g, South(c));
cWest : Cell := getCell(g, West(c));
Begin
if CellExists(g, cNorth) and not cNorth.IsMarked then
Linked_List_Coord.Append(this, cNorth.Coords);
elsif CellExists(g, cEast) and not cEast.IsMarked then
Linked_List_Coord.Append(this, cEast.Coords);
elsif CellExists(g, cSouth) and not cSouth.IsMarked then
Linked_List_Coord.Append(this, cSouth.Coords);
elsif CellExists(g, cWest) and not cWest.IsMarked then
Linked_List_Coord.Append(this, cWest.Coords);
end if;
End AddUnmarked;
之前「這個」被傳遞給函數這是我自定義類型座標(2點的整數)的Linked_List。它被初始化並且在列表傳遞給我的代碼中的上面的函數之前已經添加了一個座標對。
* facepalm *謝謝,我確實感到遲鈍大聲笑。我列出了List的功能,但沒有這個功能,所以從來沒有想到這是問題。 – Shelby115
沒問題。我也詳細闡述了一下。 – Shark8