hmmm... I've done a mistake in my previous message...
 
while ( pbuffer && *pbuffer != ' ' )
    pbuffer++;
 
It's better like this :)
 
--------------------------------------------------------
Cortex
HL Albator coder & mapper
www.hlalbator.fr.st
ICQ : 71548738
--------------------------------------------------------
----- Original Message -----
From: Cortex
Sent: Sunday, January 06, 2002 5:13 PM
Subject: Re: [hlcoders] file reading from...

If I've good understand, it does like :
 
char* pbuffer = ...;
pbuffer++; // => equal to gEnfuncs.COM_ParseFile ??
 
But... I've just finished the "parse part" I was
talking about in the previous mail :) I used the fopen/fgets solution
and it works great :)
 
--------------------------------------------------------
Cortex
HL Albator coder & mapper
www.hlalbator.fr.st
ICQ : 71548738
--------------------------------------------------------
 
----- Original Message -----
Sent: Sunday, January 06, 2002 1:50 PM
Subject: Re: [hlcoders] file reading from...

gEngfuncs.COM_ParseFile --> this grabs tokens out of the file. you must COM_LoadFile first though i think actually i'm sure..
 
then from the file you just keep using ParseFile and it'll start drawing tokens out of the file. A token is basically anything till the white space happens ie
 
hello this is a file
 
doing it the first time would drag out "hello" and the second time would drag out "this" etc. Well i fiddled with it and thats what i more or less thought.. seems to be right to me but i may be wrong.
----- Original Message -----
From: Cortex
Sent: Sunday, January 06, 2002 8:33 PM
Subject: Re: [hlcoders] file reading from...

I have a question... What does gEngfuncs.COM_ParseFile function do ?? I don't know how to use it !
Actually, I parse a file character per character with gEngfuncs.COM_LoadFile...
 
Thx
 
--------------------------------------------------------
Cortex
HL Albator coder & mapper
www.hlalbator.fr.st
ICQ : 71548738
--------------------------------------------------------
 
----- Original Message -----
Sent: Sunday, January 06, 2002 4:39 AM
Subject: [hlcoders] file reading from...

gEngfuncs.COM_ParseFile takes tokens from the file and with it i can keep grabbing tokens but each token is delimited by white space.
 
char* pFile = gEngfuncs.COM_LoadFile("commandmenu.txt", 5, NULL);
 
pFile points to commandmenus contents so i have a pointer to whats in the commandmenu.txt but thats all of it :/.
 
What i was after was if there is a way to grab from a file one line at a time until it hits the newline character '\n'.
 
i have done it so far with grabbing chunks one at a time checking each character to see if its a new line then setting back the location read... it works but i don't like the way i have done it :(.
 
All i was after is if there is a better way to read one line at a time till the end line char is reached..... or do i have to start including fstream.h to start doing this type of stuff?
 
also another thing is i was after what each of the variables COM_LoadFile takes is?
 
("commandmenu.txt", 5, NULL);
i realise the first string is the file to draw it from
dunno what the 5 is??? someone enlighten me
and from looking i am guess where NULL is you can send a length variable to
have returned the length of the file or something?? but i am not sure only NULL seems to be used everywhere.
 
thanks to anyone that can help.

Reply via email to