Incrementing a loop counter
I Have a simple script to auto add portal records. I have a variale to increment based on a DBfield holds a duration.
I can create the first record fine, then I use Set Field to increment the variable within my loop. I am using Set Field
where my variable is $Seq and the formula is ($seq = $seq + 1)
Regardles of what I do, it does not increment the $seq value and not sure what else to do.I am using Set variable initially. I can add the first row fine. I then suppose to add a 1 to $seq and use it to position to the next portal recird so on..
Set Field [$seq = $Seq + 1]
never changes, always 1. Calculation is not taken place inside the loop
To change the value of a variable such as $seq, use Set Variable. Use set Field to change the value of a field.
Using a variable as your counter:
Set Variable [ $seq ; Value: $Seq + 1 ] // note the change in syntax.
If you use a field as your counter:
Set Field [YourTable::YourField ; YourTable::YourField + 1]