Hello, could somebody tell me how its possible to read a whole line, indifferently how long the entry ist ?

Thanks four your reading...
Posted on 2003-04-11 05:56:07 by Forginforcer
Stating the obvious, but this answer is for a text file (as only textfiles have lines in them....):

read bytes in until you reach the ASCII 13 & ASCII 10 combination of bytes. Some text editors reverse that byte sequence (10&13 is the unix standard), so watch out for those files. And if it is in UniCode, then it is still 13 & 10, but they will both have a 00 in front of them (to make it a 16 bit character).
Posted on 2003-04-11 06:33:17 by sluggy
Source code: http://www.asmcommunity.net/board/index.php?topic=523&highlight=line+input

(Note that I searched for "line input"...)

Theory:

Allocate some memory, read the whole file (or a part of it) into that reserved space, allocate a target buffer, read into target buffer until you reach 13,10, work with the target buffer, move your pointer ahead over 13,10 and continue with scanning.
Posted on 2003-04-11 07:01:29 by bazik

10&13 is the unix standard),


LF equ 10
CR equ 13

Unix = LF
Mac = CR
Windows = CRLF (= bloat! :grin: )
Posted on 2003-04-11 07:03:19 by bazik
ah thanks, i thought, here ist the mothod like:

string huhu;
getline(fileobjekt, huhu);

with this commands, its possible to get a wholel ine, but i will do that with my own fist ! *hhihii*
Posted on 2003-04-11 11:16:17 by Forginforcer

ah thanks, i thought, here ist the mothod like:

string huhu;
getline(fileobjekt, huhu);



You know this forum is about assembler programming, dont you?
Posted on 2003-04-11 11:23:29 by bazik