2 ways if you are trying to save out the value of max recs in a table to re-use elsewhere.
Either on table load you add an extra field using "rowno() as NumberOfRows" as a field and do a peek-max on this field or otherwise...
If you are trying to find maximum records in table named Table1, then you can do a resident reload such as:
max(recno()) as MaximumRecords
and then use a peek to get this value in a variable, such as
LET vMaxRecs = peek('MaximumRecords', 0, 'Table2');
Hope that helps.
Sorry, forgot to explain peek function fully.
If you use rowno() to give an incremental value of each row number, then on peek, you can use -1 as offset, as it will start at bottom of table, i.e.
if in Table1 table load you add a field such as rowno() as RowNumber,
then on peek you can do
LET vMaxRecs = peek('RowNumber', -1, 'Table1');
the -1 parameter means "start at the bottom of the given table. Using 0 (zero) means start at the top of the table.
Hope it helps.