Не легче rand() использовать? :
X++:
client static int rand()
{
DLL DLL;
DLLFunction DLLFunction;
int ret;
;
DLL = new DLL("msvcr80.dll");
DLLFunction = new DLLFunction(DLL, 'rand');
DLLFunction.returns(ExtTypes::DWord);
ret = DLLFunction.call();
return ret;
}
только надо перед этим еще srand() вызвать