これは現在のコードです:
Class %Utcov.Test Extends %RegisteredObject
{
ClassMethod listClasses(ns As %String, projectName As %String)
{
// Switch namespaces to the new one
new $namespace
set $namespace = ns
// Grab our project, by name; fail otherwise
// TODO: failing is CRUDE at this point...
#dim project as %Studio.Project
#dim status as %Status
// TODO: note sure what the "concurrency" parameter is; leave the default
// which is -1
set project = ##class(%Studio.Project).%OpenId(projectName, /* default */, .status)
if ('status) {
write "Argh; failed to load", !
halt // meh... Ugly, f*ing ugly
}
w project.Items
}
ClassMethod main()
{
do ..listClasses("USER", "cache-tort-git")
}
}
まず最初に: コードがうまくいかないことはわかっています... しかし、それは学習曲線です。最終的にはもっとうまくやります... ここで解決したい問題は次の行です:
w project.Items
コンソールでは、現在次のように出力されます。
2@%Library.RelationshiptObject
しかし、私がやりたいのは、もちろんこれらのオブジェクトを循環することです。ドキュメントによれば、これらのオブジェクトは%Studio.ProjectItemの「インスタンス」です。
これらを循環するにはどうすればよいですか?WRITE
実際、私は最初からそうではないだろうと推測していました...これがObjectScriptでどのように行われるのか理解できません:/