Hm.. so, you read/write text from file dynamically?
F.e, you read door statement, then player change it, and you write it in a file again?

I chose another way: i read one time info about models from matrixes and store(and change) it there.. while level saved, i save matrixes into file one time.

But between reading info and creating models i need to store info about players somewhere else, like in your vector.


//In my case i is an int ...
But what about KDuce's note
Quote:

Thank you very much for the documentation and the code examples.

Though I gotta mention one thing about the position variable!
It not only has to be of type int it HAS to be int*

EDIT: please mention that in the documentation!



I tried this way:
Code:
void GetPlayerInfo(var s,var i, var j)
{	
	CHARACTER* tempChar = (CHARACTER*)malloc(sizeof(CHARACTER));
	while(sizeOfGSVector(vPlayers)==0) {wait(1);}
	diag("\n[!!!] Vector size:");
	diag_var(" size: %6.3f",sizeOfGSVector(vPlayers));
	
	int num;	
	for(num=0; num<sizeOfGSVector(vPlayers); num++) {
		tempChar = (CHARACTER*)(getFromGSVector(vPlayers,num));
		
		diag("\n[!!!] Vector:");
		diag_var(" s: %6.3f",tempChar.s);
		diag_var(" i: %6.3f",tempChar.i);
		diag_var(" j: %6.3f",tempChar.j);
	}
}

and this gives me

[!!!] Vector size: size: 2.000
[!!!] Vector: s: 1.000 i: 5.000 j: 5.000
Error E1513: Crash in GetPlayerInfo
Program aborted

Now, if i change order of storing values in vector, it returns
[!!!] Vector size: size: 2.000
[!!!] Vector: s: 1.000 i: 4.000 j: 2.000
Error E1513: Crash in GetPlayerInfo
Program aborted


So, from all this i can say that insertIntoGSVector works fine, but i may deal with getFromGSVector

Please, can you gibe more info about getting values from vector?


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro