sequence
START
,
INCREMENT
The sequence statement fills every visible cell in the current field with a numeric sequence.
Parameters
This statement has two parameters:
start – the starting value for the sequence.
increment – the amount the value should increase (or decrease) for each record. If this is omitted, it is assumed to be 1.
Description
This statement fills every visible cell in the current field with a numeric sequence (1, 2, 3, etc.).
This example assigns numbers to invoices that don’t have a number yet, starting with 1000.
field InvoiceNumber
select sizeof(InvoiceNumber)=0
sequence 1000 ☞ 1000, 1001, 1002, 1003, 1004, …
This example adds a new field for customer number, and automatically assigns numbers to each customer, incrementing by 5.
addfield CustNumber
fieldtype "0 digits"
sequence 10,5 ☞ 10, 15, 20, 25, 30, 35, …
The increment value doesn’t have to be positve, you can also count down.
sequence 100,-1 ☞ 100, 99, 98, 97, 96, 95, …
If the current field contains floating point numbers, the increment value doesn’t have to be an integer.
sequence 0,0.25 ☞ 0, 0.25, 0.50, 0.75, 1.00, …
If the database contains summary records, the sequence count will reset to the start value after each summary record. If you want to sequence the current field without restarting at summary records, you can use a formulafill command such as
formulafill seq()
or
formulafill Start+(seq()-1)*Increment
Legacy Syntax
In Panorama 6 and earlier, the sequence command used a different syntax. Both the start and increment were combined into a single text parameter, separated by a space. For compatibility with older databases, this syntax is still supported. Here are some examples:
sequence "1" ☞ 1, 2, 3, 4, 5, 6, …
sequence "100" ☞ 100, 101, 102, 103, …
sequence "5 5" ☞ 5, 10, 15, 25, 30, 35, …
sequence "100 -1" ☞ 100, 99, 98, 97, 96, 95, …
sequence "0.1 0.1" ☞ 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, …
See Also
- change -- replaces text with new text in the current field (selected records only).
- changeword -- replaces one word with another in the current field (selected records only).
- changewordexact -- replaces one word with another in the current field (selected records only).
- emptyfill -- fills every empty visible cell in the active field with the specified value.
- fill -- fills every visible cell in the active field with the specified value.
- fillall -- modifies the operation of the following *fill* statement so that all records are modified, not just visible records.
- formulafill -- fills every visible cell in the active field with the result of the specified formula.
- formulafillallfields -- fills every visible cell in all fields with the result of the specified formula.
- outlinelevel -- expands or collapses the entire database to show a specific level of data or summary level.
- propagate -- fills all the empty cells in the current field. Each empty cell is filled with the value of the first non-empty cell above it.
- propagateup -- fills all the empty cells in the current field. Each empty cell is filled with the value of the first non-empty cell below it.
- resetallrecordidts -- resets the internal record id and time stamps for every record in the current database.
- runmodifyfill -- runs the .ModifyFill procedure (if it exists).
- runningdifference -- calculates the running difference for the current field.
- runningtotal -- calculates the running total for the current field.
- slidedata -- slides the columns at and to the right of the current column.
- speedcopy -- copies multiple adjacent fields from a record in one database to a record in another.
- summarylevel -- changes the summary level of the current line.
- unpropagate -- removes repeating data from the currently selected field. If several records in a row contain the same data, this statement erases all but the first (top) value.
- unpropagateup -- removes repeating data from the currently selected field. If several records in a row contain the same data, this statement erases all but the last (bottom) value.
History
10.0 | Updated | Carried over from Panorama 6.0, but no longer supports the DIALOG parameter. |