I have had a hard time finding a newbie friendly example of accessing the Application Object. I have few things ( arrays ) I would like to store in the Application Object to keep as persistent data for about 2 hours until AppRecycle.
Anyhow, I know how to set an Application Object variable this way:
// One way
String[] users = new String[1000];
Application["users"] = users;
// Another way
Application.Add("users", users);
However I do not know how to access these variables once they are inside the Application Object. There is a Getter method Get
. However it requires int index
. The other method, Contents
, get's everything, not just my array.
Here I try to retrieve my String[] array, but it gives me a error that I am trying to convert Object to String.
String[] usersTable = Application["users"];
// Since this is an object i also tried Application.users but gives error