4MELFA-BASIC IV
Detailed Explanation of Functions
4-324
Max
[Function]
Obtains the maximum value.
[Format]
[Reference Program]
1 M1=Max(2,1,3,4,10,100)
' 100 is assigned to M1.
[Explanation]
(1) Returns the maximum value among the arbitrary number of arguments.
(2) The length of this instruction can be up to the number of characters allowed in a single line (123 charac-
ters).
(3) It is not possible to describe a function that contains an argument in <Equation 1>, <Equation 2> and ....
. If such a function is described, an error will be generated during execution.
[Reference]
Mid$
[Function]
Returns a string of the specified length starting from the specified position of the string.
[Format]
[Reference Program]
1 C1$=Mid$("ABCDEFG",3,2)
' "CD" is assigned to C1$.
[Explanation]
(1) A string of the length specified by argument 3 is extracted from the string specified by the first argument
starting from the position specified by argument 2 and returned.
(2) An error will be generated if equation 2 or 3 evaluates to a zero or a negative value.
(3) An error is generated if the position of the last character to be extracted is larger than the length of the
string specified by the first argument.
(4) It is not possible to describe a function that contains an argument in <Character String>, <Equation 2>
and <Equation 3>. If such a function is described, an error will be generated during execution.
[Reference]
,
<Numeric Variable>=Max(<Equation 1>, <Equation 2>, ...)
<Character String Variable >=Mid$(<Character String>, <Equation 2>, <Equation 3>)