Min$: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  MIN$(A1$,A2$,...)
  MIN$(<string>,<string>[,...])


The '''Min$''' [[internal function]] returns the smallest string value in the set of strings inside parentheses (A1$, A2$ and so on). When comparing strings, the smallest value is the one with the lowest ASCII value. If only letters of the alphabet are being compared, MIN$ will return the string that is first in alphabetical order.
The '''Min$''' [[internal function]] returns the smallest string value in the set of strings inside parentheses (A1$, A2$ and so on). When comparing strings, the smallest value is the one with the lowest ASCII value. If only letters of the alphabet are being compared, MIN$ will return the string that is first in alphabetical order.


====Comments and Examples====
====Comments and Examples====
  10 LET A$ = "red"
  10 LET A$ = "red"
  20 LET B$ = "green"
  20 LET B$ = "green"
Line 11: Line 12:
The above program will print the string "blue" (without the quotation marks).
The above program will print the string "blue" (without the quotation marks).


====Related Functions:====
====Related Functions====
 
[[MIN]] is a similar function for numbers. Similarly, [[MAX$]] and [[MAX]] return the largest values.
[[MIN]] is a similar function for numbers. Similarly, [[MAX$]] and [[MAX]] return the largest values.


====Technical Considerations====
====Technical Considerations====
:1.) The number of items that can be listed inside the parentheses is limited only by the maximum line length of 800 characters in source code or 255 characters in compiled code.
 
:2.) The COLLATE option in effect when the program was last saved or in the OPTION statement can alter the string comparisons within the MAX$ function.
# The number of items that can be listed inside the parentheses is limited only by the maximum line length of 800 characters in source code or 255 characters in compiled code.
# The COLLATE option in effect when the program was last saved or in the OPTION statement can alter the string comparisons within the MAX$ function.


<noinclude>
<noinclude>
[[Category:Internal Functions]]
[[Category:Internal Functions]]
</noinclude>
</noinclude>

Latest revision as of 17:35, 22 May 2014

MIN$(<string>,<string>[,...])

The Min$ internal function returns the smallest string value in the set of strings inside parentheses (A1$, A2$ and so on). When comparing strings, the smallest value is the one with the lowest ASCII value. If only letters of the alphabet are being compared, MIN$ will return the string that is first in alphabetical order.

Comments and Examples

10 LET A$ = "red"
20 LET B$ = "green"
30 LET C$ = "blue"
40 PRINT MIN$(A$,B$,C$)

The above program will print the string "blue" (without the quotation marks).

Related Functions

MIN is a similar function for numbers. Similarly, MAX$ and MAX return the largest values.

Technical Considerations

  1. The number of items that can be listed inside the parentheses is limited only by the maximum line length of 800 characters in source code or 255 characters in compiled code.
  2. The COLLATE option in effect when the program was last saved or in the OPTION statement can alter the string comparisons within the MAX$ function.