Help with strange string

Hello all,
In the code below, when Cmd = “G” is presented to the code below, it accepts the upper case “G” as a Lower case “g”. Can anyone tell me why it does this?

Xojo 2016R1
Thanks,
Tim

    If Cmd = "g" Or Cmd = "l" Or Cmd = "p" Or Cmd = "h" Or Cmd = "o" Then
      MakeString = MakeString + Module_Type + Cmd
    End If   

because xojo is case insensitive

Documentation for =
“Use StrComp to do a case-sensitive string comparison.”

String comparisons are case-insensitive. If you need case-sensitive comparisons, use StrComp instead:

if StrComp( Cmd, "g", 0 ) = 0 or Cmd = "1" or StrComp( Cmd, "p", 0 ) = 0 …

Or you can compare Cmd.Asc to the code point for “g”, “p”, etc.

Thanks guys.
@ Norman - yes, I know it is - this is why it makes no sense for the Upper G to be interpreted as a lower g.
EDIT - AH!!! I need to learn to read! I did not catch the “in” part of Insensitive! Sorry!

Also, this was originally done in RB - the last version. Just now picking it back up…

Tim

Text Comparison in User Guide.

Thanks again all - I’ll have a look at these.

BTW - it also did it with this code:
If Cmd = Chr(103) Or Cmd = chr(108) Or Cmd = Chr(112) Or Cmd = Chr(104) Or Cmd = Chr(111) Then

Upper G is Chr(71).
** EDIT - AH!!! I need to learn to read! I did not catch the “in” part of Insensitive! Sorry! **

In any case, so much has changed I better look at these docs. Thanks for the info and help so fast!

Tim

RealBasic/Real Studio/Xojo has always been case-insensitive. This hasn’t changed since way back.

You can also do a case sensitive comparison this way :

If ASC(Cmd) =ASC( "g") Or Cmd = "l" Or Cmd = "p" Or Cmd = "h" Or Cmd = "o" Then MakeString = MakeString + Module_Type + Cmd End If