Page 2 of 5

PostPosted: Wed May 23, 2007 2:37 pm
by Sgt. Sparky
Yes. :D

PostPosted: Wed May 23, 2007 4:42 pm
by Troodon
How can I use arrays?
I found nothing from the documentation, so I guess I don't understand it because my bad english. :roll:

PostPosted: Thu May 24, 2007 3:51 am
by Sgt. Sparky
when you make a variable put array to yes, then type in the max number of points of the integer.

or when you declare an array you can put the number of points in brackets,
example:
int myvariable[200];
that would allow 199 points(areas) to the array,
you can also make an array of arrays...
to declare 24 arrays of 199 points use
somthing like this in global code or when you use it in a code:
myvaraible[24][200];
:D

you can acces these points by using a code similar to this:
myvariable[123] = 100;
or myvariable[anothervariable] = someother variable or 100;
:D

that is pretty much it. :)
which language do you speak?(best)
I can use a translater but my gramar would not be that good. :(

PostPosted: Fri May 25, 2007 5:26 pm
by Troodon
I speak Finnish so you can't find any online translator. :P

I'm now practising the arrays. They almost work. My program can save a file but it saves only to the place 0.
The loading works, because all loads give zero expect place 0 which gives the saved number.
:)

PostPosted: Fri May 25, 2007 5:44 pm
by Sgt. Sparky
in Finnish:
oi , I-KIRJAIN perustaa ainoa!:) hyvä te raivo asento se jotta pääsy aivan vaihde jos kohta , kuin ehtiä muuttuja , kokonaisluku vieras i-kirjain. apu somthing jäljessä te ahdata se kuin:
Code: Select all
 
for ( = 0; i joukko -lta järjestää vaihde ; i++) {
kaikki mikä muuttuja eli toimia ect. = sinun muuttuja [i];
}

:)
I-KIRJAIN jälkisäädös PM te tokko se valmis ei johtua rikki aivan.
I will PM it to you if it did not come out right.

PostPosted: Fri May 25, 2007 8:19 pm
by Troodon
Sgt. Sparky wrote:in Finnish:
oi , I-LETTER found the only! :) good fury position so that access almost shift if soon , like have time to change, variable, integer guest i-letter. help somthing after you stow it like:
:)
I-LETTER will PM you whether it ready doesn't arise from broken quite.


:roll: As I said, finnish translators never work. :lol: :lol:

PostPosted: Fri May 25, 2007 8:35 pm
by Sgt. Sparky
xD...
I might just PM you then.

PostPosted: Sat May 26, 2007 10:34 am
by Troodon
I didn't got your pm but however I managed to make the array work with integers.
How can I make it work for string data?
Here is what I tried to do:

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


tulostus-tulostus9 are actors which displays the saved data
I get error messages conserning line 1.

PostPosted: Sun May 27, 2007 1:21 am
by Sgt. Sparky
that first line just plainly does not work.
xD
that is not valid code in any language. :(

PostPosted: Sun May 27, 2007 7:35 am
by Troodon
Ok, how can I make it work? Do you see what I'm trying to do?

PostPosted: Tue May 29, 2007 3:55 pm
by Sgt. Sparky
I do not see what you are trying to do. :(
(what are you trying to do in the first line?)

PostPosted: Tue May 29, 2007 7:06 pm
by Troodon
Allright

Kirjasto[10] is my array variable

It's like
kirjasto[place.textNumber], input_data.textNumber

but with text. :wink:

PostPosted: Tue May 29, 2007 7:31 pm
by Sgt. Sparky
if kirjasto is an array of string:
make a varaible called ADD,
then,
Code: Select all
ADD = input_data.textNumber;
sprintf(kirjasto[place.textNumber], "%d", ADD);

:D

PostPosted: Wed May 30, 2007 6:10 pm
by Troodon
I made this but it doesn't work.
Is there still mistakes?
Code: Select all
ADD = input_data.textNumber;
sprintf(kirjasto[place.textNumber], "%d", ADD);
saveVars("l33tfile", "l33tfile");
loadVars("l33tfile", "l33tfile");
strcpy(tulostus.text,kirjasto[0]);
strcpy(tulostus2.text,kirjasto[1]);
strcpy(tulostus3.text,kirjasto[2]);
strcpy(tulostus4.text,kirjasto[3]);
strcpy(tulostus5.text,kirjasto[4]);
strcpy(tulostus6.text,kirjasto[5]);
strcpy(tulostus7.text,kirjasto[6]);
strcpy(tulostus8.text,kirjasto[7]);
strcpy(tulostus9.text,kirjasto[8]);
strcpy(tulostus10.text,kirjasto[9]);


I still doesn't get the ADD here. Should I chance something in the srcpy lines?

EDIT: The only thing it makes; it replaces the tulostus slots with zero when I try to add string data. When I add numbers it works.

PostPosted: Wed May 30, 2007 6:39 pm
by Sgt. Sparky
tekdino wrote:I made this but it doesn't work.
Is there still mistakes?
Code: Select all
ADD = input_data.textNumber;
sprintf(kirjasto[place.textNumber], "%d", ADD);
saveVars("l33tfile", "l33tfile");
loadVars("l33tfile", "l33tfile");
ect.


did you make Add an integer?(you need to.)
but what is the Save then Load part of your text for?
(I see nothing that has to do with it in your code.)
EDIT:
also is kirjasto String or integer Array?(needs to be string)