routine READ.HELP given HELPFILE 
''
''    AUTHOR: Steve Bailey
''    CREATED: 8-31-94
''    DESCRIPTION:
''      A complete text file is read in and converted into an array of strings.
''      Each element of the array contains 1 line of text
''

define HELPFILE as a text variable
define TEXT.ARRAY as a 1-dim text array
define I, NUM.LINES as an integer variable

open unit 1 for input, name is HELPFILE
use unit 1 for input

'' first find out how many lines are in the file
let EOF.V = 1
while EOF.V eq 1 do
    add 1 to NUM.LINES
    read as /
loop

close unit 1
open unit 1 for input, name is HELPFILE
use unit 1 for input
let EOF.V = 1

'' read in all lines in the file
reserve TEXT.ARRAY(*) as NUM.LINES
for I = 1 to NUM.LINES do
      '' get the length of the line
    ''let J = 0
    ''while mode is alpha do
        ''read C as A 1
        ''add 1 to J
    ''loop

      '' read in the line of text
    read TEXT.ARRAY(I) as B 1, T 60, /
loop

close unit 1
use unit 5 for input
    
return with TEXT.ARRAY(*)
end
