News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Readln

Started by DR#m, January 13, 2005, 10:14:13 AM

Previous topic - Next topic

DR#m

please help:
i got a file, like this:

1
4
7
40
6

etc... (every line finishes with 13,10 symbols)
I want to read this integers into array. HOW??? i don`t wanna read each byte  ::)
Piece of code pls ))) any )))
So, thank U anyway...

Vortex

Hi DR#m,

If I am not wrong, Hutch's masm32 library provides a function to read lines from files. You need to convert ASCII strings to number with atodw or a similar function.

sluggy

DR#m,
welcome to the forum. You should take the time to read the rules, among them you will see:

- this is not the place to ask for answers to homework or assignments
- don't just ask for complete pieces of code, not without doing some of the code yourself first

Your question looks suspiciously like homework to me. I am going to close this thread for now, but feel free to ask questions again once you have written some of the code and you are having specific problems.
As for file handling functions, check here: MSDN: file handling functions, and more specifically ReadFile and ReadFileScatter for reading a file's contents.

Also remember that an array is just a section of memory, it is how you handle it and access it that makes it an array  :U

Lastly, check out the lib files shipped with MASM, there are file handling functions in there (check out masmlib.hlp).


donkey

I have a routine in Files.lib that will read a text file line by line and pass the lines to a callback routine. The lib is available from my website.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable