|
#1
|
|||
|
|||
|
Thanks Adam for this awesome function! (Source = AMS5 Examples forum)
What do you do when you want your application to perform a certain set of actions - but only one time ever? This function does just that. It keeps track of whether or not the actions have been called before and will return true if they have been and false if they have not. Place this code into your Global Functions section. Make sure to replace the text "Your_Application_Name" with your own unique application name. Code:
--[[ This function will be used as a way to carry out an event
the first time that the autorun is run. function ShowOnce(key)
Always test to see if the value has been saved before]]
local Saved = Application.LoadValue("Your_Application_Name", key);
-- If it has not been saved before
if Saved == "" then
-- Save the value
Application.SaveValue("Your_Application_Name", key, "TRUE");
-- Return false
return false;
else
-- This means that the value has been saved before
return true;
end
end
You can call this function and use the result from anywhere. In this example, I put the following script into the first page's OnShow event. This will hide an object if it is not the first time that the application has been run. Code:
-- call this function every time that the application is run.
Show = ShowOnce("ValueName");
if Show then
-- hide the object because it has been shown once before Label.SetVisible("Label1", false);
end
|
|
#2
|
|||
|
|||
|
and where the data is saved when using Application.SaveValue ??
registry ?, HD ? |
|
#3
|
||||
|
||||
|
This data is stored in the registry in the following key.
HKEY_CURRENT_USER\Software\Indigo Rose\ACData. HTH Tigg
__________________
TJ-Tigger "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools." "Draco dormiens nunquam titillandus." Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Function: Run it Once | Adam | AutoPlay Media Studio 5.0 Examples | 1 | 04-07-2006 02:04 AM |
| Another tough one... Interaction between Web and AMS | Agent Jones | AutoPlay Media Studio 5.0 | 13 | 08-18-2005 03:10 PM |
| Function: Resize & Center an Image | kpsmith | AutoPlay Media Studio 5.0 Examples | 0 | 05-17-2004 02:36 PM |
| Function: Parsing Command Line Arguments | Brett | AutoPlay Media Studio 5.0 Examples | 0 | 05-13-2004 09:42 AM |
| HOWTO: Limit the Number of Times an Install can be Run | Support | Setup Factory 6.0 Knowledge Base | 0 | 10-17-2002 03:58 PM |
All times are GMT -6. The time now is 08:21 PM.








Linear Mode

