Stream Class
Is the possible for Multiple Streams using in single method?
Discussion (3)0
Comments
Yes.
i want example about stream collection of datatype in a single class method
Here's an example:
Class User.NewClass1 Extends %Persistent
{
Property streams As list Of %Stream.GlobalCharacter;
ClassMethod Test()
{
do ..%KillExtent()
set obj = ..%New()
set stream1 = ##class(%Stream.GlobalCharacter).%New()
do stream1.WriteLine("Hi")
set stream2 = ##class(%Stream.GlobalCharacter).%New()
do stream2.WriteLine(123)
do obj.streams.Insert(stream1)
do obj.streams.Insert(stream2)
write $System.Status.GetErrorText(obj.%Save())
kill
set obj = ..%OpenId(1)
for i=1:1:obj.streams.Count() {
write "Stream #", i, ": ", obj.streams.GetAt(i).Read($$$MaxCacheInt)
}
}
}