Marty Knapp wrote:

When setting the passKey of a protected stack, is there a way to catch
if is valid or not? I made a change in the password of some of my stacks
along the way, and so there are two possible passKeys. If there's a way
for me to try one, then if it fails try another, I'd be a lot happier
today! My guess is that it can't be done, but maybe?

In earlier versions of Rev you could check is a stack is protected with this:

   return (the passkey of stack tStack = the password of stack tStack)

...to return true if the password had never been set or if the passkey has been entered during the current session.

Unfortunately this broke with the new, more secure, method of encrypting scripts in v4.0.

Now the only reliable method I've found also works in earlier versions but is a little longer, requiring a try/catch block:

function IsPasswordProtected pStack
  try
     get the script of stack pStack
  catch tErr
     return true -- couldn't get script
  end try
  return false -- got it OK
end IsPasswordProtected

You can use a similar try/catch setup to attempt to set the password, with the catch part coming into play if it fails.

--
 Richard Gaskin
 Fourth World
 Rev training and consulting: http://www.fourthworld.com
 Webzine for Rev developers: http://www.revjournal.com
 revJournal blog: http://revjournal.com/blog.irv
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to