In my file .txt
I want to compare a line in the file txt
Example : I want to know if 'good work' is in my txt file
I do not want to use InString.
How to compare line by line ? Have an example ?
Hello you
its good
good work
Hello
its good
good work
Hello
I want to compare a line in the file txt
Example : I want to know if 'good work' is in my txt file
I do not want to use InString.
How to compare line by line ? Have an example ?
I first load the whole txt file (and zero-terminate it!), then I copy "Hello you" byte-by-byte into a global
CommandString db 200 dup(?)
, until I reach a byte with value of 13, 10 or 0. Then I zero-terminate CommandString, and use it as I please.
For the next line, skip bytes with values of 13 and 10 until you reach some other value. If that value is 0, then stop reading and free the loaded file-data. Otherwise, repeat reading a line into CommandString.
Or you could simply just have a pointer to the beginning of the current line. But since in most cases I need to reformat the text data (remove comments, replace words....) I tend to use that CommandString global array.
CommandString db 200 dup(?)
, until I reach a byte with value of 13, 10 or 0. Then I zero-terminate CommandString, and use it as I please.
For the next line, skip bytes with values of 13 and 10 until you reach some other value. If that value is 0, then stop reading and free the loaded file-data. Otherwise, repeat reading a line into CommandString.
Or you could simply just have a pointer to the beginning of the current line. But since in most cases I need to reformat the text data (remove comments, replace words....) I tend to use that CommandString global array.
Why do you not want to use InString?
There is an example in the MASM32 example code caled GETINI that does exactly this task, reads a file into memory then line by line.
Where is the example ? because I do not find GETINI
Thx
Thx
Where is the example ? because I do not find GETINI
Thx
C:\masm32\examples\exampl11\getini
You can compress GETINI exempl and uplaod on http://rapidshare.de/ please ?
thx a lot
thx a lot
You can download the example from http://www.masm32.com/ . These files are placed in Service Pack 2 for MASM32 Version 8.2.