Page 3 of 5

PostPosted: Wed May 30, 2007 6:42 pm
by Troodon
All variables are string exept Add which is integer.

Wait, I'll write a post in a minute

PostPosted: Wed May 30, 2007 6:46 pm
by Troodon
Sparky are you still here?
It saves the array. Then it loads it so that it's always connected with the l33t file in my desktop.
The tulostus are showing the saved and loaded data.

PostPosted: Wed May 30, 2007 7:29 pm
by Sgt. Sparky
Gotchya'.
sorry,
I was busy making a Fighting Demo. :(
Are the tulostus actors text actors?(preset text, like a 0 for example?)

PostPosted: Wed May 30, 2007 7:31 pm
by Troodon
Yeah. As I said they work with number values.

PostPosted: Wed May 30, 2007 7:32 pm
by Sgt. Sparky
oh,
then you must use sprintf(tulostuswhatever.text, "%d", kirjasto[whatever]);
:D

PostPosted: Wed May 30, 2007 7:39 pm
by Troodon
Just a sec, I'll try that.

PostPosted: Wed May 30, 2007 7:43 pm
by Troodon
Did you meant like this?
Code: Select all
ADD = input_data.textNumber;
sprintf(kirjasto[place.textNumber], "%d", ADD);
saveVars("l33tfile", "l33tfile");
loadVars("l33tfile", "l33tfile");
sprintf(tulostus.text, "%d", kirjasto[0]);
sprintf(tulostus2.text, "%d", kirjasto[1]);
sprintf(tulostus3.text, "%d", kirjasto[2]);
sprintf(tulostus4.text, "%d", kirjasto[3]);
sprintf(tulostus5.text, "%d", kirjasto[4]);
sprintf(tulostus6.text, "%d", kirjasto[5]);
sprintf(tulostus7.text, "%d", kirjasto[6]);
sprintf(tulostus8.text, "%d", kirjasto[7]);
sprintf(tulostus9.text, "%d", kirjasto[8]);
sprintf(tulostus10.text, "%d", kirjasto[9]);


Now it replaces all the saved data with weird numbers starting with 44...

PostPosted: Wed May 30, 2007 7:48 pm
by Sgt. Sparky
xD
kirjasto needs to be an Integer to store number values.(an integer from of string is what it is printing now, try changing kirjasto to an integer array. :D
(sorry for the delay. :( )

PostPosted: Wed May 30, 2007 7:52 pm
by Troodon
No problems with the delay. Only I will go soon sleep so if I will not answer to a post, I'm sleeping. :lol:

That didn't work. I had to remove the line to because it was "suspicous pointing"
How should I modify the line two?
sprintf(kirjasto[place.textNumber], "%d", ADD);

EDIT: Just to be sure, here is the whole code again:

Code: Select all
ADD = input_data.textNumber;
sprintf(kirjasto[place.textNumber], "%d", ADD);
saveVars("l33tfile", "l33tfile");
loadVars("l33tfile", "l33tfile");
sprintf(tulostus.text, "%d", kirjasto[0]);
sprintf(tulostus2.text, "%d", kirjasto[1]);
sprintf(tulostus3.text, "%d", kirjasto[2]);
sprintf(tulostus4.text, "%d", kirjasto[3]);
sprintf(tulostus5.text, "%d", kirjasto[4]);
sprintf(tulostus6.text, "%d", kirjasto[5]);
sprintf(tulostus7.text, "%d", kirjasto[6]);
sprintf(tulostus8.text, "%d", kirjasto[7]);
sprintf(tulostus9.text, "%d", kirjasto[8]);
sprintf(tulostus10.text, "%d", kirjasto[9]);

PostPosted: Wed May 30, 2007 9:33 pm
by Sgt. Sparky
just accept the suspicous pointer,
I there is one in my login Demo. (it is just suspicous, nothing usually wrong with that.)

PostPosted: Thu May 31, 2007 9:06 am
by Troodon
But it's wrong with my code. The string saving isn't working.
:(

EDIT: When I try to save any data in any slot it crashes.

PostPosted: Thu May 31, 2007 4:17 pm
by Sgt. Sparky
hmmm.
I do not know about the crashing but all the numbers Are going to be zero if it loads then saves. so switch the positions of load and save. :D

Thought but not an Edit:
okay!
I know what is wrong! :D
but first:
what is kirjasto exactly?
is is string or integer or real?

PostPosted: Thu May 31, 2007 4:47 pm
by Troodon
Well, it was a string but now it's integer.
If you want, I can send you the ged and data.

PostPosted: Thu May 31, 2007 4:52 pm
by Sgt. Sparky
Code: Select all
kirjasto[place.textNumber] = input_data.textNumber;
saveVars("l33tfile", "l33tfile");
loadVars("l33tfile", "l33tfile");
tulostus.textNumber =  kirjasto[0])
tulostus2.textNumber = kirjasto[1];
tulostus3.textNumber = kirjasto[2];
tulostus4.textNumber = kirjasto[3];
tulostus5.textNumber = kirjasto[4];
tulostus6.textNumber = kirjasto[5];
tulostus7.textNumber = kirjasto[6];
tulostus8.textNumber = kirjasto[7];
tulostus9.textNumber = kirjasto[8];
tulostus10.textNumber = kirjasto[9];

and it i33file a variable?
if so your code will work,
but when using the save var function you must use:
saveVars("your variable name", "your variable's save group");
same with loadVars. :D

PostPosted: Thu May 31, 2007 4:53 pm
by Sgt. Sparky
tekdino wrote:Well, it was a string but now it's integer.
If you want, I can send you the ged and data.

only send it if my code does not work. :D