Difference between revisions of "Documentation/DevGuide/WritingUNO/Defining a Sequence"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial author Sun Microsystems, Inc.)
 
 
(8 intermediate revisions by 4 users not shown)
Line 6: Line 6:
 
|NextPage=Documentation/DevGuide/WritingUNO/Defining a Struct
 
|NextPage=Documentation/DevGuide/WritingUNO/Defining a Struct
 
}}
 
}}
 +
{{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/{{SUBPAGENAME}}}}
 
{{DISPLAYTITLE:Defining a Sequence}}
 
{{DISPLAYTITLE:Defining a Sequence}}
 
A sequence in UNOIDL is an array containing a variable number of elements of the same UNOIDL type. The following is an example of a <code>sequence</code> term:
 
A sequence in UNOIDL is an array containing a variable number of elements of the same UNOIDL type. The following is an example of a <code>sequence</code> term:
 
+
<syntaxhighlight lang="idl">
 
   // this term could occur in a UNOIDL definition block somewhere
 
   // this term could occur in a UNOIDL definition block somewhere
 
   sequence< com::sun::star::uno::XInterface >
 
   sequence< com::sun::star::uno::XInterface >
 
+
</syntaxhighlight>
 
It starts with the keyword <code>sequence</code> and gives the element type enclosed in angle brackets <code><></code>. The element type must be a known type. A sequence type can be used as parameter, return value, property or struct member just like any other type. Sequences can also be nested, if necessary.
 
It starts with the keyword <code>sequence</code> and gives the element type enclosed in angle brackets <code><></code>. The element type must be a known type. A sequence type can be used as parameter, return value, property or struct member just like any other type. Sequences can also be nested, if necessary.
 
+
<syntaxhighlight lang="idl">
 
   // this could be a nested sequence definition
 
   // this could be a nested sequence definition
 
   sequence< sequence< long > >
 
   sequence< sequence< long > >
Line 19: Line 20:
 
   // this could be an operation using sequences in some interface definition  
 
   // this could be an operation using sequences in some interface definition  
 
   sequence< string > getNamesOfIndex(sequence< long > indexes);
 
   sequence< string > getNamesOfIndex(sequence< long > indexes);
 +
</syntaxhighlight>
 +
{{PDL1}}
  
{{PDL1}}
+
[[Category:Documentation/Developer's Guide/Writing UNO Components]]
[[Category: Writing UNO Components]]
+

Latest revision as of 16:21, 23 December 2020



A sequence in UNOIDL is an array containing a variable number of elements of the same UNOIDL type. The following is an example of a sequence term:

  // this term could occur in a UNOIDL definition block somewhere
  sequence< com::sun::star::uno::XInterface >

It starts with the keyword sequence and gives the element type enclosed in angle brackets <>. The element type must be a known type. A sequence type can be used as parameter, return value, property or struct member just like any other type. Sequences can also be nested, if necessary.

  // this could be a nested sequence definition
  sequence< sequence< long > >
 
  // this could be an operation using sequences in some interface definition 
  sequence< string > getNamesOfIndex(sequence< long > indexes);
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages