Difference between revisions of "LASTSEQNO()"
Yvonne.milne (Talk | contribs) m (1 revision) |
Helen.george (Talk | contribs) |
||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Function to return the current 'SEQNO' value | Function to return the current 'SEQNO' value | ||
− | |||
==Syntax== | ==Syntax== | ||
LASTSEQNO([<workarea | alias>]) | LASTSEQNO([<workarea | alias>]) | ||
− | |||
==See Also== | ==See Also== | ||
[[CURRSEQNO()]], [[SEQNO()]], [[SET SEQNO]], [[ZAP]] | [[CURRSEQNO()]], [[SEQNO()]], [[SET SEQNO]], [[ZAP]] | ||
− | |||
==Description== | ==Description== | ||
Line 19: | Line 16: | ||
The LASTSEQNO() function is synonymous with the CURRSEQNO() function. | The LASTSEQNO() function is synonymous with the CURRSEQNO() function. | ||
− | |||
==Example== | ==Example== | ||
Line 40: | Line 36: | ||
− | + | ||
− | + | ||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] |
Revision as of 12:12, 7 December 2012
Contents
Purpose
Function to return the current 'SEQNO' value
Syntax
LASTSEQNO([<workarea | alias>])
See Also
CURRSEQNO(), SEQNO(), SET SEQNO, ZAP
Description
The LASTSEQNO() function returns the current 'SEQNO' value. The SEQNO value is a unique sequence number generated on a per table basis. The LASTSEQNO() function differs from the SEQNO() function in that CURRSEQNO() returns the current sequence number for a table and SEQNO() increases the current sequence number by one and then returns the value. Including the optional <workarea | alias> parameter will cause the LASTSEQNO() function to operate on the specified table. If there is no active table the LASTSEQNO() function will return 0.
A ZAP operation will reset the sequence number to 0. The sequence number of a table can be reset with the command SET SEQNO TO <expN>.
The SET SEQNO command and LASTSEQNO() and SEQNO() functions are only supported for Recital tables.
The LASTSEQNO() function is synonymous with the CURRSEQNO() function.
Example
use newtable ? seqno() 1 ? seqno() 2 ? lastseqno() 2 ? lastseqno() 2 set seqno to 0 ? lastseqno() 0 ? seqno() 1