news
About Elegant Chaos
info
About me and my friends
people
Software from Elegant Chaos
software
Other stuff...
stuff

FL_CopyResource

Revision
Revised on

Description

Copy a resource from one stack to another. Takes the name of the source and destination stacks, and the name and type of the resource to copy.

It has to actually go to both stacks, so its not a particularly fast way of copying lots of resources from one place to another.


Code

on FL_CopyResource from,to,name,type
  global XStatus, XError
  
  -- lock stuff and go to the source
  UL_LockAndPush
  go stack from
  
  -- get a handle to the resource
  put Rezzer(handle,name,type) into resourceHandle
  if XStatus is ok then
    
    -- go to destination stack and save resource
    go stack to
    get Rezzer (save,resourceHandle)
    if XStatus is not ok then
      answer "Error copying resource:" & return & return & the params & return & XStatus & ":" && XError
    end if
  end if
  
  -- go back to where we were
  UL_UnlockAndPop
end FL_CopyResource