To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=73511
                 Issue #|73511
                 Summary|Mismatch between Rnd / Randomize Help and implementati
                        |on
               Component|framework
                 Version|OOo 2.1
                Platform|All
                     URL|
              OS/Version|Windows XP
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P4
            Subcomponent|scripting
             Assigned to|kr
             Reported by|terrye





------- Additional comments from [EMAIL PROTECTED] Tue Jan 16 03:10:49 -0800 
2007 -------
Sorry but another one thrown up by answering an oooforum topic:  
http://www.oooforum.org/forum/viewtopic.phtml?t=51526

According to /basic/source/runtime/methods.cxx, the Rnd() RTL function actually
just does a 
  return (double)rand() / (double)RAND_MAX.  
Likewise the Randomise() statement (that is with no parameter does a 
  nSeed = (INT16)rand()

However the corresponding help (helpcontent2/source/text/sbasic/shared files
03080302.xhp and 03080301.xhp) incorrectly state that 
(Randomize:)  "If Number is omitted, the generator uses the current value of the
system timer."  This is patently not the case.
(Rnd:) "Parameters: Expression: Any numeric expression that defines how to
generate random numbers. Less than zero: Always returns the same random number.
Greater than zero: Returns the next random number in the sequence. Zero: Returns
the random number that was last generated. Omitted: Returns the next random
number in the sequence. If the same number is passed for each successive call to
the Rnd function, the same random-number sequence is generated. This is because
the Expression parameter is used as a starting point for the next number."

Whoever wrote the help did so on the aspiration that these both worked like VBA
(since the wording seems to be a paraphrase of the VBA help).  However the code
does nothing like this.  You need to modify one or the other so that they are
consistent.  If you let me know which you prefer then I can give you the
appropriate changes.  

BTW I recommend VBA compatibility, especially since the effect of Randomize() is
to do no such thing !

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to