Question
· Feb 28, 2020

Create a list of messages in studio

Do you have any clue how to create a list of messages in studio ?

Example :

I can define one message that is called DoctorInfoMsg such as 

set DoctorInfoMsg= ##class(PKGNotification.InDoctorInfo).%New()

 

Where PKGNotification.InDoctorInfo is composed of 

Property UserName As %String;

Property ListOfPatients As list Of %String;

 

How to define a list of PKGNotification.InDoctorInfo messages ?

How to get UserName of the first message?

Discussion (6)1
Log in or sign up to continue

Thank you Eduard.

To clarify, I don't have a problem with defining the properties in a message.

My question is how to define a list of messages. What's the syntax ?

Unfortunately, I couldn't find my answer in this documentation.

I want something similar to 

set mylist=##class(%ListOfDataTypes).%New()

But instead of ListOfDataTypes I want List of DoctorInfoMsg

Thanks again :) 

Hi Ali,

Here is a sample of using %ListOfObjects:

SAMPLES>set list=##class(%ListOfObjects).%New()
 
SAMPLES>set t1=##class(HoleFoods.Transaction).%OpenId(1)
 
SAMPLES>d list.Insert(t1)
 
SAMPLES>w list.Count()
1
SAMPLES>set t2=##class(HoleFoods.Transaction).%OpenId(2)
 
SAMPLES>d list.Insert(t2)
 
SAMPLES>w list.Count()
2
SAMPLES>w list.GetAt(1)
2@HoleFoods.Transaction
SAMPLES>w list.GetAt(1).%Id()
1
SAMPLES>w list.GetAt(2).%Id()
2
SAMPLES>w list.GetAt(2).AmountOfSale
6.95