RE: SDL-News: random number gen


Subject: RE: SDL-News: random number gen
Louis.Verhaard#gambro.com
Date: Thu Nov 26 1998 - 08:20:37 GMT


The originator of this message is responsible for its content.
-----From Louis.Verhaard#gambro.com to sdlnews -----

Hi Oliver,

Here is a method to generate random integers with SDT using C's random
number
generator function rand( ):

put in a text symbol the following external procedure declaration:

procedure rand;
returns integer;
external;

Now you can assign an integer variable a random value in the following way:

rand_value := call rand

This should work with all kernels (simulator, validator, application) as
long as the C
library supports the rand( ) function. The solution only works in SDT 3.1 or
higher.
By declaring srand in a similar way, you can also set the seed for random
number
generation.

Hope this helps.

Louis Verhaard
Gambro AB
Sweden

-----End text from Louis.Verhaard#gambro.com to sdlnews -----
For help, email "majordomo#sdl-forum.org" with the body of your email as:
    help
or (iff this does not answer your question) email: owner-sdlnews#sdl-forum.org



This archive was generated by hypermail 2a23 : Sun Jun 16 2013 - 10:41:40 GMT