news |
info |
people |
software |
stuff |
To be certain that you're renaming the right stack, pass the full path of it. If just the current name is specified for the stack, Hypercard will rename the first stack it finds with that name, which might not be the one you had in mind!
Note that the stack is only renamed, it isn't moved to a different folder.
function FL_RenameStack oldPath, newName -- rename a stack (but keep it in the same folder) -- set up default result put false into theResult -- get full path of new stack put FL_StackFolder(oldPath) & newName into newPath -- check that there isn't already a stack with the new name if there is a stack oldPath then if there is not a stack newPath then -- do the renaming put the cantModify of stack oldPath into oldmod set the cantModify of stack oldPath to false set the name of stack oldPath to newName set the cantModify of stack newPath to oldmod put true into theResult end if end if -- return result saying whether renaming was succesful return theResult end FL_RenameStack