[FONT=Arial, Arial, Helvetica]begin[/FONT]
[FONT=Arial, Arial, Helvetica]counter := 1;[/FONT]
[FONT=Arial, Arial, Helvetica]assignfile(my_file,'textfile.txt'); [COLOR=#008000]//names.txt is the actual file on disk[/COLOR][/FONT]
[FONT=Arial, Arial, Helvetica]reset(my_file); [COLOR=#008000]//gets textfile ready for use[/COLOR][/FONT]
[FONT=Arial, Arial, Helvetica]while not eof(my_file) do[/FONT]
[FONT=Arial, Arial, Helvetica] [/FONT][FONT=Arial, Arial, Helvetica]begin[/FONT]
[FONT=Arial, Arial, Helvetica] [/FONT][FONT=Arial, Arial, Helvetica]readln(my_file,myarray[counter]);[COLOR=YellowGreen] [COLOR=Green]//reading the line and assigning it [/COLOR][/COLOR]
[/FONT]
[FONT=Arial, Arial, Helvetica] [/FONT][FONT=Arial, Arial, Helvetica]counter := counter + 1;[/FONT]
[FONT=Arial, Arial, Helvetica] [/FONT][FONT=Arial, Arial, Helvetica]end;[/FONT]
[FONT=Arial, Arial, Helvetica]closefile(my_file);[/FONT]
[FONT=Arial, Arial, Helvetica]end;[/FONT]