Page 1 of 1

reading data from file

PostPosted: Sun Jan 14, 2007 4:37 pm
by mt
i have created a text file, which is my sort of like my database of player names. it has 2 columns.first for the name and second for what type of player he is.
now i want to read the data from that file and display the name using text actor.plz if any one knows how to do it, help us?

PostPosted: Sun Jan 14, 2007 6:22 pm
by Game A Gogo
i think it tells you how to read from *.txt files in the documentation http://game-editor.com/docs

PostPosted: Mon Jan 15, 2007 12:30 am
by makslane

PostPosted: Mon Jan 15, 2007 2:57 pm
by mt
thankz i figured it out. :)

help needed again

PostPosted: Wed Jan 17, 2007 8:56 am
by mt
ok i did it like this.
FILE *fptr;
fptr=fopen("myfile.txt","r");
fscanf(fptr,"%s",&mystringvariable);
strcpy(mytextactor.text,mystringvariable);

it works and it displays the text from the file but now i want to increment the pointer(fptr) to the next line when the player is out. but i don't want to display the name of the player that has already been out. should i save the out player inanother file and compare them or something? need help plz... :?

PostPosted: Wed Jan 17, 2007 1:05 pm
by makslane
The file pointer already incremented after the read.

PostPosted: Thu Jan 18, 2007 3:18 pm
by mt
but i want to increment after the player is out. :( i guess im not explaining it right. oh well i'll try to figure this out somehow.