|
|
Re: Number of elements in an array?
[Re: NITRO777]
#328846
06/15/10 16:09
06/15/10 16:09
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
one measly line missing jumps out at me...
. ...
while(file_find(filehandle, " ")>=0) count++;
globalTester = count;//to watch the variable
file_seek (filehandle, 0, 0); // reset read position back to start of file
while(temp < count)
...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Number of elements in an array?
[Re: NITRO777]
#328856
06/15/10 16:55
06/15/10 16:55
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
FYI :: if it tickles your fancy, as it does mine, the "action" code can be compressed down to a single line in lite-c....
//originally
// these 3 lines have to be added to every entity that needs to be recorded
max_ents += 1; // get a unique entity number
my.skill99 = max_ents; // and store it inside skill99
play(my.skill99); // put this line here
//becomes
// now its just this one line, and it still does everything the old one did.
play((my.skill99=max_ents++));
and before you ask, "yes", the doubled brackets ARE required. And Im pretty certaing you could just put play(max_ents++);in the action if you put my.skill99 = max_ents;into the first line of the 'play' function...
Last edited by EvilSOB; 06/15/10 17:00. Reason: second thoughts...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Number of elements in an array?
[Re: NITRO777]
#328861
06/15/10 17:17
06/15/10 17:17
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Im looking forward to seeing your results...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|