Allows to decrease an counter module by 1.

 

See chapter Limit number of program starts. To decrease the counter module for other values use SetVal, Token TLI.

 

Name

ValidateAndDecrease                  

Purpose

Validates a counter module and decrease the number of licenses by 1.

Params

Parameter

Type

Example

Note

ModuleID

String

D1004

Unique ModuleID – identifies the module to be tested

Returncode

Returncode

Type Integer

Note

All values

See list of return codes

32

Number of licenses is 0 and can’t be decreased any more

Usage

ValidateAndDecrease is intended to count down a counter modules (Type 3). If should not be used with other module types.

ValidateAndDecrease could be used to allow a module or programme to be started only a limited number of times.

Sample

 

  iRes := lic.ValidateAndDecrease(‘D1003’);

  if iRes = 0 then

  begin

     << successfully validated, the number of licenses is decreased by 1 >>

     ...

  end

  else if iRes = 1 then

  begin

     << successfully validated, it’s a demo version and the number of licenses is decreased by 1 >>

     ...

  end

  else if iRes = 32 then

  begin

     << successfully validated, but the number of licenses is 0 and can not be decreased any further >>

     ...

  end

  else if iRes = 4096 then

  begin

     << D1003 seems to be not a Module of type 3. Use Validate instead… >>

     ...

  end

  else

  begin

     << validation failed, usage of module not allowed >>

     ...

 

See also

Prepare, Quit, ValidateEx, Validate, ValidatesYes