loadOrCreateObject ( string name , object objectValueIfCreated , bool|default:true _isDisplayWarning , string _pathFile ) : object
Allows to load a variable previously saved with saveObject. It is useful for long analysis where it can have an interruption.
Returns the object.
Example
profilesToCheck=loadOrCreateObject("profilesToCheck",[])
profilesToCheck.each{profile->
...
profilesToCheck.add(newProfile)
saveObject("profilesToCheck",profilesToCheck)
}
See also
saveObjectloadAllObjects
saveAllObjects
isGlobalVariableExists
Parameters
name
name of the object saved with saveObject
objectValueIfCreated
If no saved object exists, the object is created with this value
_isDisplayWarning (optional)
At the first call, this tool ask if we need to load the last state of variables saved. If _isDisplayWarning = false, we consider you argee. If _isDisplayWarning = -1, we consider you disargee.
_pathFile (optional)
You can indicate a special path on your disk for this object. Else it is loaded from the folder savedObject of Grimport Crawler.