Has a class been compiled?
Is there an easy way to see if a class object has been compiled or needs to be? Or to get a list of classes that need to be compile in a particular namespace?
Comments
In SMP / Explorer you can get
class by name and its last date .png)
under routines
the object by related name
- - - -- - - -
In addition in Studio, a class that is saved but not compiled
is marked with + after the name .png)
while a changed class that is neither saved nor compiled
is marked by * .png)
I have no idea if VSCode or Atelier have similar features.
If you want to know if a compiled class exists, call:
write $$$comClassDefined(class)It, however, does not answer the question of a compiled version being current.
$system.OBJ.IsUpToDate()might fit the bill for your first question.
set sc = $system.OBJ.GetClassList(.classes)
set cls="", outdated=""
for {
set cls = $order(classes(cls))
quit:(cls="")
if '$system.OBJ.IsUpToDate(cls) set outdated = outdated _ $lb(cls)
}
for i=1:1:$listlength(outdated) {
write $listget(outdated, i)
}should work for your 2nd question (documentation here: https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic…)
using SQL you can compare the last change between definition and compilation of classes
a negative difference shows where recompilation is required.
I used Posix-Timeformat for an easier compare
SELECT
def.ID, cmp.TimeChanged compiled, def.TimeChanged defined,
to_char($piece(cmp.TimeChanged,',',1),'J')-to_char($piece(def.TimeChanged,',',1),'J') diff
FROM %Dictionary.ClassDefinition def
left outer join %Dictionary.CompiledClass cmp
on def.ID=cmp.ID
where NOT def.name %startswith '%'
order by 4