Why not just read the text file into an array using an initialisation function? and then just access the array with the address? This will perform far better than opening and closing the file on every single read access.
--- Quote Start ---
note hread is only compatible with vhdl-2008
--- Quote End ---
technically correct, but you included the non-standard library std_logic_textio which is a 3rd party library that gave you the ability to read/write directly to std_logic/std_logic_vector with VHDL 1993. The functionality of this package is included in std_logic_1164 in VHDL 2008.