Hello to everyone,
I would like to build a phone book application with a listview and some columns like name, phone ...., i would like to save to a txt file, as delimiter i would like this "|", and after every row i want a new line in the txt file , and the file must be loaded on every program start.
I have written an application like this in vb.net express, and now i would like to build the same application in winasm studio with masm32 code.
The only problem is the file loading nad saving algo.
Would anyone help me please?
paste some code then, maybe someone will help.
Reading a file line by line is pretty slow, you should memory map the file then scan it using string functions or a loop for CR/LF, that will indicate the end of a given line. At that point the parser is fairly straight forward. If you are only using the single delimiter type it is just as easy to scan the memory mapped file for the delimiter OR CR/LF and plug the values into your listview "on the fly", this will make load times quite a bit faster. When you're done the with file close the mapping object and the file and you're done.
Donkey
Quote from: donkey on May 05, 2007, 12:18:07 AM
Reading a file line by line is pretty slow, you should memory map the file then scan it using string functions or a loop for CR/LF, that will indicate the end of a given line. At that point the parser is fairly straight forward. If you are only using the single delimiter type it is just as easy to scan the memory mapped file for the delimiter OR CR/LF and plug the values into your listview "on the fly", this will make load times quite a bit faster. When you're done the with file close the mapping object and the file and you're done.
Donkey
Thank you for answering.
Can you show me an example?
There is an example of this in WinExplorer, just look at the way the Hex Viewer works, it uses a method close to this one.
Donkey
Thank you but where can i find this example?
http://www.masm32.com/board/index.php?topic=3803.0
Thank you! :U