Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Intersystems cache 系统间缓存:如何将宏名称存储在变量中,然后对其求值_Intersystems Cache_Intersystems_Intersystems Ensemble_Intersystems Iris - Fatal编程技术网

Intersystems cache 系统间缓存:如何将宏名称存储在变量中,然后对其求值

Intersystems cache 系统间缓存:如何将宏名称存储在变量中,然后对其求值,intersystems-cache,intersystems,intersystems-ensemble,intersystems-iris,Intersystems Cache,Intersystems,Intersystems Ensemble,Intersystems Iris,如何将宏名称存储在变量中,然后在以后使用它 例如: Set myVariable = "AssertEquals" Do $$$myVariable(...) 或 我想我可以做如下的事情,但那也不行(我得到的类不存在) 不可能,宏是在编译时消耗的,但您将在运行时使用它们。我认为你应该更好地解释你实际上要实现的目标。如果你问的话,你会得到更多的答案。不可能,宏在编译时消耗掉了,但你会在运行时使用它们。我认为你应该更好地解释你实际上要实现的目标。如果你问,你会得到更多的答案。好的,谢谢。我们只是

如何将宏名称存储在变量中,然后在以后使用它

例如:

Set myVariable = "AssertEquals"

Do $$$myVariable(...)

我想我可以做如下的事情,但那也不行(我得到的类不存在)


不可能,宏是在编译时消耗的,但您将在运行时使用它们。我认为你应该更好地解释你实际上要实现的目标。如果你问的话,你会得到更多的答案。

不可能,宏在编译时消耗掉了,但你会在运行时使用它们。我认为你应该更好地解释你实际上要实现的目标。如果你问,你会得到更多的答案。

好的,谢谢。我们只是尝试循环一组单元测试,其中测试类型(例如AssertEquals)是在表列中定义的。那么,为什么不使用这种方式呢
Do$CLASSMETHOD(“当前测试用例类”、“AssertEqualsViaMacro”、…)
当我执行以下操作时,我会得到一个错误。类UnitTests.MyTest扩展了%UnitTest.TestCase{Method TestAdd(){………Do$CLASSMETHOD(“UnitTests.MyTest”,“AssertStatusOKViaMacro”,tStatus,“Testing…”)请参见下面的错误。LogStateStatus:0:TestAdd:error#5002:Cache error:zTestAdd+3^ UnitTests.MyTest.1*AssertStatusOKViaMacro,UnitTests.MyTest抱歉,它应该是
$method($this,“AssertEqualsViaMacro”,“here some description”,…args)
谢谢。我正在尝试循环一组单元测试,其中测试类型(例如AssertEquals)是在表列中定义的。那么,为什么不这样做呢?
Do$CLASSMETHOD(“当前测试用例类”、“AssertEqualsViaMacro”,…)
当我执行以下操作时,我会得到一个错误。class UnitTests.MyTest扩展了%UnitTest.testcase{Method TestAdd(){………Do$CLASSMETHOD(“UnitTests.MyTest”、“AssertStatusOKViaMacro”、“tStatus”、“Testing…”见下面的错误。LogStateStatus:0:TestAdd:error#5002:Cache error:zTestAdd+3^ UnitTests.MyTest.1*AssertStatusOKViaMacro、UnitTests.MyTest抱歉,它应该是
$方法($this,“AssertEqualsViaMacro”,“此处有一些说明”,…args)
Set myVariable = "$$$AssertEquals"

Do myVariable(...)
Do $CLASSMETHOD("%UnitTest.TestCase","AssertEqualsViaMacro",....)