[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]


TYPE: Floating-Point Function
FORMAT: LOG(<numeric>)

Action: Returns the natural logarithm (log to the base of e) of the argument. If the value of the argument is zero or negative the BASIC error message ?ILLEGAL QUANTITY will occur.

EXAMPLES of LOG Function:
   25 PRINT LOG(45/7)

   10 NUM=LOG(ARG)/LOG(10)  (Calculates the LOG of ARG to the base 10)


TYPE: String Function
FORMAT: MID$(<string>,<numeric-1>[,<numeric-2>])

Action: The MID$ function returns a sub-string which is taken from within a larger <string> argument. The starting position of the sub-string is defined by the <numeric-1> argument and the length of the sub-string by the <numeric-2> argument. Both of the numeric arguments can have values ranging from 0 to 255.

If the <numeric-1> value is greater than the length of the <string>, or if the <numeric-2> value is zero, then MID$ gives a null string value. If the <numeric-2> argument is left out, then the computer will assume that a length of the rest of the string is to be used. And if the source string has fewer characters than <numeric-2>, from the starting position to the end of the string argument, then the whole rest of the string is used.

EXAMPLE of MID$ Function:
   10 A$="GOOD"
   30 PRINT A$ + MID$(B$,8,8)


[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated December 22, 2002.