RndSno Random Type (serial numbers)

Action

Generates serial numbers of type integer. For each call, the RndSno type returns a value incremented by one over the previous call.

Syntax

RndSno( in nStart : number ): number;

Return value

number

Parameter Description
nStart Starting value of the function

Example

dclrand
  rCube  : RndUniN(1..6);
  rPrice : RndUniN(10..2000);
  rArtNo : RndExpN(1..10000: 100.0);
  rACat  : RndStr("AABBCCDDEEFF0123456789", 3..4);
  rName  : RndStr(10..40);
  rLfdNo : RndSno(1);

dclsql
  InsArticle:
    INSERT INTO article (articlenumber, category, name)
    VALUES (:rLfdNo, :rACat, :rName);

The random variable rLfdNo is used in a SQL command to generate serial number values for the database field articlenumber. The first value generated is 1.