howdy yall. I noticed I messed up on the pointer and loop based addressing system in 's'
oops
I guess no one was really using those features since no one complained. but here's the new working version
http://dl.dropbox.com/u/1013446/New%20f ... 6%29/s.rar
they're both handy features. somewhere in these 12 pages is the explanation of what they do, but I'll do a quick reminder here for anyone interested.
The Set Pointer action lets you make a pointer
I'll use an actual example from my current project where I realized they weren't working and fixed them
I had a bunch of events that looked like this:
[quote:ymgud9jw]add objectarray "icon" to super {"window",s.sule({"window"}),"entries",s.sule({"window",s.sule({"window"}),"entries"})}
needless to say that's very ugly, hard to read, and easy to make a mistake with, so with a pointer I could say
[quote:ymgud9jw]Set Pointer "currententry" to {"window",s.sule({"window"}),"entries",s.sule({"window",s.sule({"window"}),"entries"})}
then I can do this instead of the original way
[quote:ymgud9jw]add objectarray "icon" to super {"p","currententry"}
the "p" at the start of an address tells s the next part of the address is a pointer name, and it will act as if instead of "p","pointername" you typed in all that stuff that you set the pointer to
you can also use pointers in pointer addresses, which I actually did in the same example like
[quote:ymgud9jw]Set Pointer "currentwindow" to {"window",s.sule({"window"})}
and when I needed to use something within that address over and over I did:
[quote:ymgud9jw]Set Pointer "currententry" to {"p","currentwindow"),"entries",s.sule({"window",s.sule({"window"}),"entries"})}
you can use them as partial addresses as you see above as well, where I started the address with the pointer and the continued on to go in entries within that pointed to super
the loop address thing does the same thing
if you're in a loop(an s loop, not a system loop), say you're looping through some insane address
[quote:ymgud9jw]{"window",s.sule({"window"}),"entries",s.sule({"window",s.sule({"window"}),"entries"})}
and your loop is called "myentries"
anywhere you need to refer to that long address you can just use
[quote:ymgud9jw]{"l","myentries"}
and all the same rules as the pointers talked about above work, except you start with "l" for 'loop' instead of "p" for 'pointer'
it's especially useful as you being looping through an array, and then looping a loop within that one of another array within the first one, etc, etc, and you not only don't have to type in the whole address you're looping through each time you add another nesting loop, or when you need to access the size of an array or something from a very outer loop, you don't have to keep track of any of the addresses
one last thing about pointers by the way...they can kinda be used as variables, too
no special commands or anything, but for example, let's say you have two object arrays, one called "air targets", and one called "ground targets"
you can set a pointer called "current targets"
then do all your commands on that address, and not care which array it's currently pointing to
oh yeah, last last thing about pointers. it's meant to be simple, if you Set a Pointer you haven't set yet, it is created, if it has already been set, it will be overwritten with the new address