If VariableName specifies a comma-separated list of object variables and DataType is an object class, each variable is assigned a separate OREF. For example, the following assigns separate OREFs to each variable:
#dim j,k,l As Sample.Person = ##class(Sample.Person).%New()
This is equivalent to:
SET j = ##class(Sample.Person).%New()
SET k = ##class(Sample.Person).%New()
SET l = ##class(Sample.Person).%New()
However, if you omit the As DataType qualification (not a common use case), all variables receive the same OREF:
#dim j,k,l = ##class(Sample.Person).%New()
The result here is equivalent to:
SET j = ##class(Sample.Person).%New()
SET k = j
SET l = j
If VariableName specifies a comma-separated list of variables and DataType is a Dynamic object class, each variable is assigned a separate OREF, as in the case of ordinary object classes. For example, the following assigns separate OREFs to each variable:
#dim m,n,o As %DynamicObject = {"name":"Fred"}
The same is true for this:
#dim p,q,r As %DynamicArray = ["element1","element2"]
However, if you omit the As DataType qualification (not a common use case), all variables receive the same OREF, as in the case of ordinary object classes.