Mitsubishi MELFA CR1D Instruction Manual page 344

Table of Contents

Advertisement

4MELFA-BASIC IV
Rnd
[Function]
Generates a random number.
[Format]
<Numeric Variable>=Rnd(<Equation>)
[Terminology]
<Equation>
<Numeric Variable>
[Reference Program]
1 DIM MRnd(10)
2 C1=Right$(C_Time,2)
3 MRndBS=Cvi(C1))
4 MRnd(1)=Rnd(MRndBS)
5 For M1=2 TO 10
6 MRnd(M1)=Rnd(0)
7 Next M1
[Explanation]
(1) Initializes random numbers using the value provided by the argument and extracts a random number.
(2) If the equation provided as the argument evaluates to 0, initialization of random numbers will not take
place and the next random number will be extracted.
(3) When the same value is used to perform initialization of random numbers, identical random number
sequence will be obtained.
Right$
[Function]
Obtains a string of the specified length starting from the right end.
[Format]
<Character String Variable >=Right$(<Character String>, <Equation>)
[Reference Program]
1 C1$=Right$("ABCDEFG",3)
[Explanation]
(1) Obtains a string of the specified length starting from the right end.
(2) An error will be generated if the value of the second argument is a negative value or is longer than the
first string.
(3) It is not possible to describe a function that contains an argument in <Character String> and <Equation>.
If such a function is described, an error will be generated during execution.
[Reference]
Left$, Mid$,
Len
4-331 Detailed Explanation of Functions
Specifies the initial value of random numbers. If this value is set to 0, subsequent random numbers
will be generated without setting the initial value of random numbers.
A value in the range of 0.0 to 1.0 will be returned.
' Initializes random numbers using the clock.
' in order to obtain different sequence of numbers.
' Sets the initial value of random numbers and extracts the first random
number.
' Obtain other nine random numbers.
' "EFG" is assigned to C1$.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melfa cr2dMelfa cr3d

Table of Contents