Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ExpressionResult
$day = $weekDays[3]Sets $day to "Wednesday"
$i = 3, $day = $weekDays[$i+2]Sets $day to "Friday"
$day = getElement($weekDays,4)Sets $day to "Thursday"
$day = $weekDays.3Sets $day to "Wednesday"
$day = $weekDays[9]Sets $day to _NULL since there is no element at position 9
$weekDays = _NULL, $day = $weekDays.3Sets $day to _NULL since there is no element at position 3 (in fact there are no elements at all)
$weekDays = [], $day = getElement($weekDays,3)Sets $day to _NULL since there is no element at position 3 (in fact there are no elements at all)

 


Similarly, to set the value of the nth item in an Array, use setElement(array,n,value):

...

ExpressionResult
$accountNum = account.accountNumaccount.accountNum returns the value of the Attribute accountNum within the Record Set account. Because the Pipe just returns a single value, $accountNum is a single value (not an Array).
$invoiceNumbers = invoices.numberinvoices.number returns an Array of the Attribute number within the Record Set invoices.

$firstInvoiceNumber = invoices.number[1]

$firstInvoiceNumber = invoices.number.1

$firstInvoiceNumber = invoices.number[$j]


This gets the first invoice number.

This gets the first invoice number.

This get the invoice number for position $j in the array. 

Note that the dot notation does not work with a variable e.g. invoices.number.$j

$firstInvoice = invoices[1], $firstInvoiceNumber = $firstInvoice.numberThis also gets the first invoice number. Note that the Record Set invoices[1] has been assigned into a $-Variable.
$attr = "number", $invoiceNumbers = invoices.$attrThis also creates an Array of the invoice numbers. Note that the $-Variable $attr has been set to the name of the Attribute which is then used to decide which Attribute to read from invoices.

...