hasSubjectData( name )
Tests if the current subject has any subject data with the given name.
Like loadSubjectData(), this function works very quickly because the subject data already cached in-memory, so this function does not need to “hit” the database.
Arguments
name |
The name of the subject data to test for. |
Returns
true if the subject has saved data with the given name, otherwise this function returns false.
Example
Loads an important piece of subject data from the database.
1 2 3 4 5 6 7 8 |
// Only load the subject data if the subject actually has the data define somethingImportant = "missing" if hasSubjectData("MyData") then print("Loading subject data: MyData") somethingImportant = loadSubjectData("Mydata") else print("MyData did not exist on the subject") end if |
For a much more comprehensive example please see the “Long-term memory” example experiment.