PDA

View Full Version : Some basic questions...



Hanji
03-27-2003, 08:49 PM
These are both pretty simple, but the LScript docs are, in my opinion, pretty weak (Yes, I have looked through them):
1)How do I get the length of an array?
2)Does the Mac version of LW have the LSIDE, and if so, how the heck do I get to it?(I have LW v7.5)

Answers to either would be greatly appreciated.

Tom Speed
03-27-2003, 10:47 PM
Hi,

The size() data member returns the exact size of the array. There is another useful data member called count() , that returns the amount of elements that contain a value.



{
a[1]=4;
a[2]=6;
a[3]=nil;
a[4]=7;
a[5]=nil;

info( a.size() ); // prints 5
info( a.count() ); // prints 3
}


Check the LScriptReference PDF, Chapter 12 for more info.

I'm running on a PC here so no Idea about the Mac version of LSIDE.

Cya!
Tom