On Thursday, March 24, 2005, at 06:59 AM, Ted Spencer wrote: >> Would you believe there's an even simpler solution that's nearly 8 >> times faster yet?! I can't believe I didn't think of it sooner. >> >> DIM Ctnr$$ >> XREF@ ctnrx``(_maxLong) >> >> Ctnr = "anything" ' Must init ctnr before this works >> ctnrx = [@Ctnr] ' After Ctnr is initialized (or filled), set ctnrx >> to its handle. >> >> theChar`` = ctnrx(x - 1) ' Retrieve the xth char from Ctnr. >> >> There's still no range or error checking, but this should be fast >> enough and simple enough for anything you want to do. It reads those >> same million chars in 0.03 seconds, and it's easier to use! > > Thank you twice. > This, latter, should leave few complaints in its wake, except for > those whose eyes are too weak to see the ``. That's why I prefer [ ]. Sorry, I should have used: XREF@ ctnrx(_maxLong) AS CHAR Isn't it great that I can use one syntax for brevity while you use another for legibility, and they both work equally well? You probably realize the ``'s following theChar`` are superfluous. I included it them as a reminder that you are getting a bite result. It can go into any type of numeric var. I should also point out that you can use the ctnrx() array for ANY (non-nil) container, just by plugging in its handle: ctnrx = [@myOtherCtnr$$] So if you're dealing with 2 or more of these containers, you have quick, easy access to each just by moving an address. I, too, am fond of the string$[x] syntax, but there are too many inherent difficulties and lurking dangers (because of the handle) for me to support extending it to container$$[x], even if Andy had that "spare time." If it were done safely, then it wouldn't be very fast. You've got me thinking, though.... If containers were redone in dynamic array format, we could gain both speed and safety. But containers and dynamic arrays are available as different things and should probably remain that way. e-e =J= a y " -- To unsubscribe, send ANY message to: futurebasic-unsubscribe@...