Managing substacks - best way?

rev at armbase.com rev at armbase.com
Wed Jul 6 11:26:43 EDT 2005


Quoting Jim Bufalini <YourSignup at Yahoo.com>:

> Hi all,
>
> Lets say you create a substack or someone shares a stack with a library or
> other type of substack that you want to incorporate in other projects.
> What's the best way to separate out that substack from the original Main
> stack (without actually separating it from the original project by setting
> it's main stack to itself) and then, adding it to another project?

I clone a substack of a .exe using this script.

global tStackName, tFileName
on doFileNew
  ask file "Name new database file:" with "MyDatabase.abd"
  if it is empty then exit to top
  put it into tFileName
  if char -4 to -1 of tFileName is not ".abd" then put ".abd" after tFileName
  set the itemDelimiter to "/"
  put last item of tFileName into tStackName

--Puts the filename you created into a variable that can be used to name the
stack later

  set the visible of stack "Master Database" to false
  clone stack "Master database"

-- so you dont see it popup on cloning


  set the name of stack it to tStackName
  set the title of stack tStackName to (char 1 to -5 of tStackName)
  set the minWidth of stack tStackName to 800
  set the minHeight of stack tStackName to 600
  set the fileName of stack tStackName to tFileName
  -- "tFileName" is the full pathname of the file the user named earlier.
  set the visible of stack "Master Database" to true
  put the stackFileType into tSaveStackFileType
  set the stackFileType to "RevoABD_"
  save stack tStackName
  set the stackFileType to tSaveStackFileType
  show stack tStackName
  toplevel stack tStackName
end doFileNew


I'm sure you can canibalise bits of this. I think I originally canibalised this
one from the list or bits from the employee database that came with earlier
versions of runrev.

hope ot is of use.

cheers
bob
>
> I've been setting the substack to a main stack of itself. Saving the
> substack. Closing the original main stack without save. Opening a new main
> stack. Opening what was the substack. Setting the main stack of the opened
> former substack to the new main stack. Kind of a PITA (Pain In The A__).
> Isn't there a better way?
>
> Jim
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>







More information about the use-livecode mailing list