const
minlist = 1;
maxlist = 5;
maxword = 7;
type
listrange = minlist .. maxlist;
wordrange = 1..maxword;
word = record
contents: packed array [wordrange] of char;
length: wordrange
end;
wordlist = array[listrange] of word;
var
i: integer;
words: wordlist;
procedure CreateList(var w: wordlist);
begin
w[1].contents := 'print ';
w[1].length := 5;
w[2].contents := 'out ';
w[2].length := 3;
w[3].contents := 'the ';
w[3].length := 3;
w[4].contents := 'text ';
w[4].length := 4;
w[5].contents := 'message';
w[5].length := 7;
end;
begin
CreateList(words);
for i := minlist to maxlist do
with words[i] do
WriteLn(contents: length);
for i := maxlist downto minlist do
with words[i] do
WriteLn(contents: length)
end.
Tidak ada komentar:
Posting Komentar
terimakasih aras kunjungan anda di blog mesujiraya
komentarnya saya tunggu mas bro & mbak sist