home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
xactus.zip
/
macros
/
rand.xc$
/
xsmp32
/
os2
/
uk
/
rand.xcd
Wrap
Text File
|
1994-09-29
|
1KB
|
26 lines
/*************************************************************************
* Xact macro
*
*************************************************************************/
Parse Arg handle
Say "This simple macro opens a new table window " ||,
"and creates 100 random numbers in the range of 0 to 100."
tHandle = XR_OpenTab() /* Create a new table */
Call XR_WriteCell tHandle, i, 1, "Number" /* set the title of column 1 */
Call XR_WriteCell tHandle, i, 2, "Random" /* set the title of column 2 */
rand = Random(0, 100, Time('S')) /* create a random number */
/* 'seed' is no. of seconds since midnight */
Do i = 1 To 100
rand = Random(0, 100) /* create a random number */
Call XR_WriteCell tHandle, i, 1, i /* write line number into column 1 */
Call XR_WriteCell tHandle, i, 2, rand /* write random number into column 2 */
End
Return