User bio
404 bio not found
Member since Oct 17, 2018
Posts:
Replies:
Daniel McGowan · Jun 25, 2020 go to post

Ahhhhhh, i didn't know that! Well in that case it works! looks alot tidier now then:

ClassMethod ExecuteClassMethods(Functions As %DynamicArray) As %Status
{
	s arrFns = Functions.%GetIterator()

	while arrFns.%GetNext(.Key, .Obj) {

		s arrArgs = Obj.Arguments.%GetIterator()

		while arrArgs.%GetNext(.aKey, .Item) {
			s Args = aKey + 1
			s Args(Args) = Item
		}
		
		d $ClassMethod(Obj.Class, Obj.Method, Args...)
	}

	q $$$OK
}
Daniel McGowan · Jun 25, 2020 go to post

Well when i try that in the above code as:

ClassMethod WriteSegment(Functions As %DynamicArray) As %Status
{
	s arrFns = Functions.%GetIterator()

	while arrFns.%GetNext(.Key, .Obj) {
		s arrArgs = Obj.Arguments.%GetIterator()

		while arrArgs.%GetNext(.aKey, .Item) {
			s Args(aKey + 1)=Item
		}
		d $ClassMethod(Obj.Class, Obj.Method, Args...)

	q $$$OK
}

i get an error in the called function: <UNDEFINED>zWriteSomething+1^Report.Elements.1 *Arg1 the Args array looks like this: Args(1)="Hi"

Certifications & Credly badges:
Daniel has no Certifications & Credly badges yet.
Followers:
Daniel has no followers yet.
Following:
Daniel has not followed anybody yet.