RANDOMIZE(1134157108); FOR I := 1 TO 50 DO BEGIN J := RANDOM(10); IF (J<1) OR (J>10) THEN ERROR('RANDOM(10) returned %1', J); END;
--------------------------- Microsoft Dynamics NAV Classic --------------------------- RANDOM(10) returned -8 --------------------------- OK ---------------------------
Comments
And it's still in 2009 sp1 classic.
On RTC it works fine and you don't get the error.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Any reason why you RANDOMIZE that number? Why don't you just use current datetime as the default does?
FD Consulting
As for the RTC; the good thing is that it seems to give values in the right range; bad thing it that for a given value the sequence returned is different from the classic client. But as Navision isn't really used for simulation this shouldn't be a problem.
I suppose I should raise it with Microsoft.
TVision Technology Ltd
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
True, but should probably still be told to Microsoft. Can't imagine it would be anything but a low priority bug fix, though.
My Blog - nav.education
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Ahh, no. ABS(0) is still zero, and yes the function sometimes returns zero too.
TVision Technology Ltd
j := ABS(j)
if J = 0 then j = 1;
anyways I hope you've reported it to MS.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Tell the truth I'm still annoyed about the ***p^W messing about with a bug report that I gave up on last month. Basically it came down to a "won't fix" resolution despite other parts of Microsoft agreeing with me that it was a bug. Now there's nothing inherently wrong with the "won't fix" resolution, however, they then decided to charge support call 9572935 as ", as an error has not been identified."
It didn't 'cost' us anything as the "bundled 20 support incidents" were already written off but it's still really stupid.
Say, as they seem to love the "bombarded with legalese" technique would you have a page or two of capslocked verbiage that tells then to ***k off rather than 'charge' something?
Or, maybe, thought I doubt it, they've actually got a bug reporting system now buried somewhere on their MSIE site.
BTW: I've switched to using a good quality PRNG called "Multiply with carry", it's a minor change on the normal linear congruential generators that I always thought looked like a good idea but never had the maths to even try to prove.
TVision Technology Ltd