Detecting Upper and Lower Case - Forum

Forum Navigation
You need to log in to create posts and topics.

Detecting Upper and Lower Case

Has any one figured out how to detect if keystrokes are upper or lower case?

I have tried this but doesn't work:

If "[TextEntry1]" "=" "[#65]"
AlertBox "" "Upper Case"
EndIf
If "[TextEntry1]" "=" "[#97]"
AlertBox "" "Upper Case"
EndIf

Apparently NB recognizes the input as both #65 and #97.

 

@pauljonestindall

I did some experiments; it appears that the variable [TextEntry1] contains the correct upercase/lowercase values ... but the If/EndIf command does not differentiate between upper and lower cases ... this ...

SetVar "[lowercaseD]" "d"
If "[lowercaseD]" "=" "D"
   AlertBox "Case" "[lowercaseD] is Upper"
EndIf

... gives me a "d is Upper" response.

Note that the TextEntry widget gives you options (in the Style section) to ...

a) only accept specified characters (Validation)
b) force upper or lower case (Text case)

... perhaps your real requirements might be met by working around the limitations of the If/End command.

@pauljonestindall

You can use the plugin hpwControl  (Hans-Peter Wickern)

Commands:

hpwStrSearch

hpwStrNthSearch