1
我想創建,打印11個按鈕,所以我想用數組中的程序使用這些按鈕的唯一變化的是名稱添加值到帕斯卡爾的陣列 - iIllegal限定詞」
當我嘗試。編譯,我得到的錯誤「非法預選賽」在我的第一個數組賦值。
type
buttonName = array[0..11] of String;
procedure PopulateButton(const buttonName);
begin
buttonName[0] := 'Sequence';
buttonName[1] := 'Repetition';
buttonName[2]:= 'Modularisation';
buttonName[3]:= 'Function';
buttonName[4]:= 'Variable';
buttonName[5]:= 'Type';
buttonName[6]:= 'Program';
buttonName[7]:= 'If and case';
buttonName[8]:= 'Procedure';
buttonName[9]:= 'Constant';
buttonName[10]:= 'Array';
buttonName[11]:= 'For, while, repeat';
end;
,並在主我試圖用這個循環
for i:=0 to High(buttonName) do
begin
DrawButton(x, y, buttonName[i]);
y:= y+70;
end;
請知道,我是很新的這和我不太瞭解我在數組,參數/常量等方面的知識。
謝謝
請記住更改主要部分! –
非常感謝你!修好了一切。我需要刷新我的參數定義。 – denpa
你可能還需要刷牙打字。你的參數沒有類型。這在一些動態類型的語言中很酷,但不在Pascal/Delphi中。 –