object oRoom; string sRoomId; string sChannelId; boolean bFirst = true; boolean bFirstSecond = true; Write("{"); Write('"Rooms":['); foreach (sRoomId, dom.GetObject(ID_ROOMS).EnumUsedIDs()) { if (bFirst == false) { WriteLine(','); } else { bFirst = false; } oRoom = dom.GetObject(sRoomId); Write("{"); Write('"ID":"' # oRoom.ID()); Write('","Name":"' # oRoom.Name()); Write('", "TypeName":"' # oRoom.TypeName() # '_ROOMS'); Write('", "EnumInfo":"'); WriteURL(oRoom.EnumInfo()); Write('", "Channels":['); bFirstSecond = true; foreach(sChannelId, oRoom.EnumUsedIDs()) { if (bFirstSecond == false) { Write(','); } else { bFirstSecond = false; } Write('"'); Write(dom.GetObject(sChannelId).Address()); Write('"'); } Write(']}'); } Write(']}');