How would I go about reading a text file from a file on disk into an array in memory?
Also, I noticed using ReadLn only shows the first line (seems kind of obvious, since it is ReadLn, but how would I go about reading the whole text document?)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That returns the file’s contents in a string which can be indexed and so could be considered to be an array.
Or perhaps you want an array of strings rather than an array of characters, in which case it’s easiest just to use the string list directly: