The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: fusspot on August 27, 2007, 07:35:35 AM

Title: use contents of text file as data in program
Post by: fusspot on August 27, 2007, 07:35:35 AM
How do I make the contents of a text file available to my program?
How does my program use these contents as data?
Title: Re: use contents of text file as data in program
Post by: MichaelW on August 27, 2007, 08:51:02 AM
One method is to open the file, get the size, allocate a buffer, read the file data into the buffer, and then access the buffer as you would any other data. The MASM32 library read_disk_file procedure (masm32\m32lib\readdisk.asm), or the InputFile macro, can be used to automate the process.