Results 1 to 5 of 5

Thread: Usage of the MAX$ MIN$ Keywords

  1. #1
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Usage of the MAX$ MIN$ Keywords

    I dont get this keyword whats its purpose, whats it doing?

    [code=thinbasic]
    ' Usage of the MAX$ Keyword example
    ' Usage of the MIN$ Keyword example
    '
    ' Written by Abraxas


    DIM MyNo1String as string value "What"
    DIM MyNo2String as string value "is"
    DIM MyNo3String as string value "the"
    DIM MyNo4String as string value "Value"
    DIM sMsg as string

    sMsg += "String 1 " & MyNo1String & $CRLF
    sMsg += "String 2 " & MyNo2String & $CRLF
    sMsg += "String 3 " & MyNo3String & $CRLF
    sMsg += "String 4 " & MyNo4String & $CRLF & $CRLF
    smsg += "MAX$ " & MAX$(MyNo1String, MyNo2String, MyNo3String, MyNo4String) & $CRLF
    smsg += "MIN$ " & MIN$(MyNo1String, MyNo2String, MyNo3String, MyNo4String) & $CRLF

    MsgBox 0, sMsg

    [/code]
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Usage of the MAX$ MIN$ Keywords

    Taken. Thank
    Added a note to help to remember MAX$ and MIN$ are case sensitive.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: Usage of the MAX$ MIN$ Keywords

    but what do they do?
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Usage of the MAX$ MIN$ Keywords

    Return the maximum or minimum value from a list of strings.
    Comparison for max or min is done using full ascii set so they are case sensitive.
    To avoid this, just pass only capitalized (upper or lower) strings.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #5
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: Usage of the MAX$ MIN$ Keywords

    I see it now perhaps this might be worth adding.

    [code=thinbasic]
    DIM MyNo1String as string value "What" ' ascii values 87 104 97 116
    DIM MyNo2String as string value "is" ' ascii values 105 115
    DIM MyNo3String as string value "the" ' ascii values 116 104 101
    DIM MyNo4String as string value "Value" ' ascii values 86 97 108 117 101

    [/code]
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

Similar Threads

  1. Usage of (some) OS Keywords
    By Michael Clease in forum Samples for help file
    Replies: 1
    Last Post: 30-05-2007, 11:59

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •