Differentiate between upper and lower case in ListBox - Forum

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

Differentiate between upper and lower case in ListBox

Help. In a Listbox I can end up with Items:
A
a
B
b
...
Content of the variable = Text of the item (in upper or lower case)

Each letter must trigger a different action:
If "[Zone_de_liste1]" "=" "A"
... Action
If "[Zone_de_liste1]" "=" "a"
... Action
If "[Zone_de_liste1]" "=" "B"
... Action
If "[Zone_de_liste1]" "=" "b"
... Action
etc ...

How to make so that the selection of "A" is not either that of "a", but "A" for "A" and "a" for "a",
and no longer "A" for "a" or "a" for "A".
Whether the action matches the upper or lower case letter.
Ditto for each item ... B, b, C, c, D, d, ... etc ...

"A" is not a duplicate of "a" and "a" is not a duplicate of "A"
Ditto for each item ... B, b, C, c, D, d, ... etc ...

Thank you for any directions or ideas ... I'm blocking

Claude GUYOT
NeoBook in French Version: 5.8.7

 


Bien différencier majuscule et minuscule dans ListBox

Help. Dans une Listbox je peux me retrouver avec des Items:
A
a
B
b
...
Contenu de la variable = Texte de l'item (en majuscule ou en minuscule)

Chaques lettres doit déclencher une action différente :
If "[Zone_de_liste1]" "=" "A"
... Action
If "[Zone_de_liste1]" "=" "a"
... Action
If "[Zone_de_liste1]" "=" "B"
... Action
If "[Zone_de_liste1]" "=" "b"
... Action
etc ...

Comment faire pour que la sélection de "A" ne soit pas non plus celle de "a", mais "A" pour "A" et "a" pour "a",
et non plus "A" pour "a" ou "a" pour "A".
Que l'action corresponde bien à la lettre majuscule ou minuscule.
Idem pour chaque items ... B,b,C,c,D,d,... etc...

"A" n'est pas un doublon de "a" et "a" n'est pas un doublon de "A"
Idem pour chaque items ... B,b,C,c,D,d,... etc...

Merci pour toutes orientations ou idées ... Je bloque

Claude GUYOT
NeoBook in French Version: 5.8.7

@proforma-guyot

Looks like the If command does a case-insensitive compare.

I tried ...

If "[ListBox1]" "=" !A"

... and that worked ... but ...

If "[ListBox1]" "=" !a"

... did not :-(

So, the workaround involves use of string commands that have the "CaseSensitive" options i.e. SearchStr or StrReplace ... here is a suggestion that deploys SearchStr ...

SearchStr "A" "[ListBox1]" "[FoundA]" "CaseSensitive"
If "[FoundA]" "=" "1"
AlertBox "ListBox1" "A"
... replace AlertBox with your desired actions
EndIf

SearchStr "a" "[ListBox1]" "[Founda]" "CaseSensitive"
If "[Founda]" "=" "1"
AlertBox "ListBox1" "a"
... replace AlertBox with your desired actions
EndIf

 

proforma.guyot has reacted to this post.
proforma.guyot

Thanks Gaev,

Uppercase and lowercase are now respected in my actions via a ListBox.

Thank you again for your intervention.

Claude GUYOT

NeoBook in French Version: 5.8.7

Exemple à coller dans nouvelle Pub 640 x 480 :

{NeoBook 5 Objects}
NeoBookVer=5,80
ObjectType=3
Name=Bouton_poussoir2
X=7
Y=24
W=95
H=43
Anchor=0
Text=[Tabs1]
Align=2
ImageStyle=0
BevelWidth=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=3
ObjectType=3
Name=Bouton_poussoir3
X=101
Y=24
W=95
H=43
Anchor=0
Text=[Tabs2]
Align=2
ImageStyle=0
BevelWidth=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=5
ObjectType=3
Name=Bouton_poussoir4
X=195
Y=24
W=95
H=43
Anchor=0
Text=[Tabs3]
Align=2
ImageStyle=0
BevelWidth=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=4
ObjectType=3
Name=Bouton_poussoir5
X=289
Y=24
W=95
H=43
Anchor=0
Text=[Tabs4]
Align=2
ImageStyle=0
BevelWidth=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=2
ObjectType=5
Name=Rectangle1
X=7
Y=66
W=460
H=407
Anchor=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
TabOrder=6
ObjectType=10
Name=Zone_de_liste1
X=498
Y=68
W=118
H=406
Anchor=0
Text=A¶a¶B¶b¶C¶d¶Etc...
VarName=[Zone_de_liste1]
VarType=0
ObjAction=SearchStr "" "[Zone_de_liste1]" "[Found]" "CaseSensitive"¶If "[Found]" "<>" "1"¶SetVar "[Tabs1]" ""¶SetVar "[Tabs2]" ""¶SetVar "[Tabs3]" ""¶SetVar "[Tabs4]" ""¶EndIf¶¶SearchStr "A" "[Zone_de_liste1]" "[FoundA]" "CaseSensitive"¶If "[FoundA]" "=" "1"¶SetVar "[Tabs1]" "Tabs1A"¶SetVar "[Tabs2]" "Tabs2A"¶SetVar "[Tabs3]" "Tabs3A"¶SetVar "[Tabs4]" "Tabs4A"¶EndIf¶¶SearchStr "a" "[Zone_de_liste1]" "[Founda]" "CaseSensitive"¶If "[Founda]" "=" "1"¶SetVar "[Tabs1]" "Tabs1a"¶SetVar "[Tabs2]" "Tabs2a"¶SetVar "[Tabs3]" "Tabs3a"¶SetVar "[Tabs4]" "Tabs4a"¶EndIf¶¶SearchStr "B" "[Zone_de_liste1]" "[FoundB]" "CaseSensitive"¶If "[FoundB]" "=" "1"¶SetVar "[Tabs1]" "Tabs1B"¶SetVar "[Tabs2]" "Tabs2B"¶SetVar "[Tabs3]" "Tabs3B"¶SetVar "[Tabs4]" "Tabs4B"¶EndIf¶¶SearchStr "b" "[Zone_de_liste1]" "[Foundb]" "CaseSensitive"¶If "[Foundb]" "=" "1"¶SetVar "[Tabs1]" "Tabs1b"¶SetVar "[Tabs2]" "Tabs2b"¶SetVar "[Tabs3]" "Tabs3b"¶SetVar "[Tabs4]" "Tabs4b"¶EndIf
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=1

Claude GUYOT

 

Uploaded files:
  • You need to login to have access to uploads.