Is there any way to access property from another string?

Class A Extends %Persistent


Property Doctor1 As %Library.String;

Property Doctor2 As %Library.String;

Property Doctor3 As %Library.String;


I know my solution is wrong, but if i want to access A.Doctor1, can I  get a way like 

s count=1

s DoctorName="Doctor"_""_count


  • 0
  • 0
  • 101
  • 1
  • 1


Do you want to access properties without coding them?

Use $property for that:

set obj = ##class(A).%New()

for i=1:1:3 {

   set $property(obj, "Doctor" _ i) = ##class(%PopulateUtils).Name()


zwrite obj