> I don't always know that it is going to be a script.  There are times
> when
> I want to use this to instantiate a stack of xtras, in which case I
> would need:
> 
> newStackObject = new(xtra stackScrip/XtraName)
> 
> I tried to address this by using typeofstack, which would be either
> "xtra" or "script", and objectofstack, which would be the name of what I
> am declaring.

Can you "case" your typeofstack variable:

on addnewstackobject me
  if (stack.count < maxsizeofstack) then
    case(typeofstack) of
      "script":
        stack.append((script objectofstack).new())
      "xtra":
        stack.append((xtra objectofstack).new())
    end case
    return stack.count
  else
    recycled = findrecycledstackobject()
    if (not(voidP(recycled))) then
      return recycled
    end if
  end if
  return void
end addnewstackobject

(NB: I also altered your VOID test)

HTH,
-Sean.
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to