[Ohrrpgce] thoughts about slice handles

James Paige Bob at HamsterRepublic.com
Wed Jan 14 21:59:43 PST 2009


Well, I just chose an arbitraraly large number. There might be other 
types of handles I would want to convert this way too. For example, the 
existing menu handles, which don't really have a limit to speak of.

And there would not actually be any wasted space. I would allocate the 
memory something like this:

 DIM plotslices(100000 TO 100063)

and I would expand it something like this:

 REDIM PRESERVE plotslices(LBOUND(plotslices) TO UBOUND(plotslices) + 
64)

Anyway, as I think about this more, I am not sure if I want to take this 
approach or not.

Another option is to just make a couple commands like: 
 create string slice(stringID)
 update string slice(stringID)

---
James

On Wed, Jan 14, 2009 at 09:38:35PM -0800, S'orlok Reaves wrote:
> 
> Given my limited knowledge of how the Standard OHR actually works, this still seems to handle things well. My main question is: what takes up slots 32 to 99999? I don't like the idea of excessive wasted space, unless it's unavoidable. 
> 
> -->Seth
> 
> 
> --- On Wed, 1/14/09, James Paige <Bob at HamsterRepublic.com> wrote:
> 
> > From: James Paige <Bob at HamsterRepublic.com>
> > Subject: [Ohrrpgce] thoughts about slice handles
> > To: ohrrpgce at lists.motherhamster.org
> > Date: Wednesday, January 14, 2009, 1:12 PM
> > So I am thinking about slice handles.
> > 
> > As I have implemented them so far, slice handles are >0
> > indexes into the 
> > plotslices() array.
> > 
> > I was thinking about the conversion of floating plotstrings
> > to string 
> > slices. String handles are currently static numbers from
> > 0-31
> > 
> > What if I make it so that slice handles start at some
> > higher number like 
> > say 100000. now, slice handle 100000 would actually be
> > plotslices(0) and 
> > 100001 would be plotslices(1)
> > 
> > So suppose you pass a static string handle of 31 to
> > "append ascii"
> > 
> > That slice handle would be pulled from a static unfreeable
> > list of 
> > string slice handles created when the program starts.
> > 
> > But if you pass 100004 which happens to be the return
> > result of "new 
> > string slice" as the handle for "append
> > ascii", then it will know to 
> > pull that string slice handle from plotslices(4).
> > 
> > Even though plotslices() and staticstringslices() would be
> > separate 
> > tables, they would still be populated with pointers to
> > slices in the 
> > same slice tree, so old static strings would be fully
> > interchangeable 
> > with other slices for string operation purposes.
> > 
> > That would NOT give you the ability to use old static
> > string handles for 
> > things like anchor & alignment changes or
> > tree-heirachy-relocation, but 
> > that would be okay.
> > 
> > The same approach could be used later also for other
> > handles that get 
> > converted into slices (for example, maybe custom menu
> > handles).
> > 
> > This seems like the best approach to enable slices while
> > maintaining 
> > backwards compatability with existing code, and with the
> > right wrapper 
> > functions it would not be to rough to code.
> > 
> > Any thoughts?
> > 
> > ---
> > James Paige
> > _______________________________________________
> > Ohrrpgce mailing list
> > ohrrpgce at lists.motherhamster.org
> > http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
> 
> 
>       
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
> 
> 



More information about the Ohrrpgce mailing list