Hello!

The documentation mentions:

        In addition there is a special form of array index that can be
        used to access fields in a field list
        (see 10.1) by index instead of by name. This special form of
        array index starts with a + sign as the
        first character after the opening [ as shown in the following
        example:
        <!-- a sample field list -->
        <fieldlist>
        <field name="NAME" type="string"/>
        <field name="TEL_1" type="telephone"/>
        <field name="TEL_2" type="telephone"/>
        <field name="TEL_3" type="telephone"/>
        </fieldlist>
        
        /* sample script to access the telephone numbers by index
        instead of by name */
        integer i;
        telephone a,b,c;
        a = TEL_1[+0]; // this is the same as: a=TEL_1
        b = TEL_1[+1]; // this is the same as: b=TEL_2
        c = TEL_1[+2]; // this is the same as: c=TEL_3

Does this also work for fields which are arrays? Like this:

      <field name="TEL"         array="yes" type="telephone" 
compare="conflict"/>
      <field name="TEL_FLAGS"   array="yes" type="integer"   
compare="conflict"/> <!-- offset 0 -->
      <field name="TEL_LABEL"   array="yes" type="string"    
compare="conflict"/> <!-- offset 1 -->
      <field name="TEL_ID"      array="yes" type="integer"   
compare="conflict"/> <!-- offset 2 -->
      <field name="TEL_SLOT"    array="yes" type="integer"   compare="never"/>  
  <!-- offset 3 -->

      a = TEL[+1][3]; // same as TEL_FLAGS[3]

I tried it briefly, but got a syntax error which implied that the first
square brackets were treated like a normal array index in TEL.

What would it take to make this work?

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.




_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to