Skip to main content
Open topic with navigation CAPL Functions » General » Function Overview » random

random

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

Function Syntax

dword random(dword num);

Description

Calculates a random number between 0 and num-1.

Parameters

Determines the interval.

Return Values

Random number between 0 and num-1.

Example

dword x;
// generate random number in the interval [0;99]
x = random(100);
runError