global.defined()
Returns a structure indicating whether a global reference is defined, whether it has data, and whether it has subscripts.
Arguments
None. The global reference is set when instantiating the lib.cfmumps.Global component. See Globals API Instantiation for more information on instantiating the Globals API for use.
Return Value
Returns a struct with the following boolean members:
- hasData
- hasSubscripts
- defined
Example
CFScript
glob = new lib.cfmumps.Global("myGlobal", ["key"]); if(glob.defined().defined) { Â writeOutput("^myGlobal(""key"") is defined");Â } if(glob.defined().hasData) { Â writeOutput("^myGlobal(""key"") has data");Â }Â if(glob.defined().hasSubscripts) { Â writeOutput("^myGlobal(""key"") has subscripts");Â }Â glob.close();Â
CFML
<cfset glob = new lib.cfmumps.Global("myGlobal", ["key"])> <cfif glob.defined().defined> ^myGlobal("key") is defined<br> </cfif> <cfif glob.defined().hasData> ^myGlobal("key") has data<br> </cfif> <cfif glob.defined().hasSubscripts> ^myGlobal("key") has subscripts<br> </cfif>