Hello,

Does anyone have an example of how to use Lists in python? I have an IDL file like this:

struct msgROField
{
       1: string Name;
       2: double Value;
}

struct msgROFields
{
       1: list<msgROField> ROField;
}

struct InstitutionRecord
{
       1: string REC_ID;
       2: i32 NumROFields;
       3: msgInstitution Institution;
       4: msgCSA CSA;
       5: msgROFields ROFields;
}

I can use the structures, except for the msgROFields. As I use the InstitutionRecord object, I assign the objects appropriately - i.e.:

iRec = InstitutionRecord()
iRec.ROFields = msgROFields()

My problem is this.  I cannot add do something similar to this:

iRec.ROFields.append(msgROField())

If I inspect the data structure in a debugger, I see that there is *one* ROField element under the ROFields structure. But there's no way to do the standard Python list operations on either the ROFields or ROField elements.

Any ideas?

Thanks!
-Josh

Reply via email to