public function getRandom(in iMin, in iMax, out aRand[]) {
auto iRange, i;
if (iMin < 0 || iMin > iMax || (iMin + iMax)==0)
return -1;
if (int(iMin) != iMin || int(iMax) != iMax)
return -1;
iRange=(iMax-iMin) + 1;
srand(GetTickCount());
for (i=0; i<iRange; i++)
aRand[i] = int(rand()*iRange) + iMin;
return 0;
}
#When used with the following calling code, random output listings were created.
if (getRandom(1,5,aRnd)==E_OK)
{
buf="";
for (i=0; i<10; i++)
buf = buf & " " aRnd[i];
print(buf);
}
texit;
这个也HELP里面的例子作者: 初来乍到 时间: 2004-12-22 13:58
谢谢了,我看看。我说呢,难道这么多高手没有给指点一下的吗。看来还是有好人的