/* This is a multi-line comment */ // Declare a variable of type Object Object o // Assign each Object in the current Module to o for o in current Module do { // Declare a variable of type string string objectText // Put the Object's Object Text into the string variable objectText = o."Object Text" // If the text contains a shall, print the Absolute Number of the object if matches("shall", objectText) then print o."Absolute Number" "\n" }
The syntax of DXL has a slight resemblance to C and C++ but there are important differences, for example:
- There is no need to end each statement with a semi-colon
- The use of parentheses is often not required
- There is no need for a 'main()' function
The code above demonstrates:
- Declaration of variables (o and objectText)
- A 'for' loop that is repeated for all visible Objects in the current Module
- Accessing the contents of an Object's Attributes ("Object Text" and "Absolute Number")
- A call to a DXL function (matches)
- A conditional statement (if) that performs an action if a condition is met
All of this will be examined in more detail elsewhere in this wiki