AMT Help Files
homeLION Language ReferenceCommandsCOUNT (CNT)

COUNT (CNT)

Syntax

COUNT (<Source>, <Result>)

Description

When used inside a loop, 'readfile' loop or 'query' loop and in conjunction with the LEVEL_BREAK command the number of loop iterations between two level breaks is counted and the result is copied into the result variable.

Diagram

Returned value type

None

Parameters

Parameter Description
<Source> Not used, but a source variable has to be supplied for symmetry reasons.
<Result> The name of the object to place the resulting average in.

Remarks

Count will only work in conjunction with the LEVEL_BREAK command inside a general loop, a 'readfile' loop or 'query' loop.

Example

readfile (lbfile, rec_lbf)
  lay_emp.dept   := rec_lbf.dept
  lay_emp.empnr  := rec_lbf.empnr
  lay_emp.salary := rec_lbf.salary
  lay_hdr.hdept  := rec_lbf.dept
  level_break (rec_lbf.dept, lay_ftr, lay_hdr, 3)
  count (rec_lbf.salary, lay_ftr.count)
  maximum (rec_lbf.empnr, lay_ftr.maxemp)
  variance (rec_lbf.salary, lay_ftr.varsal)
  print (lay_emp)
endread

Return to

Commands

Contents

 Go to top