StringcaseSense, Variables and parsing problem

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Posts: 668
Joined: 29 Sep 2013, 22:18

StringcaseSense, Variables and parsing problem

11 Feb 2019, 20:05

I want to be able to create variables in upper and lower case. I thought stringcasesense would help but so far what I have doesn't work:

Code: Select all

StringCaseSense, on

h := "hello world!"

test := "Hh"
loop, parse, test
	line := A_loopfield ": " %A_loopfield%
	msgbox, %line%
I'm only seeing "hello world!". Can someone please help so both variables display? Thanks.
User avatar
Posts: 5750
Joined: 19 Dec 2016, 01:58
Location: UK

Re: StringcaseSense, Variables and parsing problem

11 Feb 2019, 20:33

Variables in AutoHotkey are case insensitive. So H and h are the same variable.

Code: Select all

h := "hello world!"
MsgBox, % H "`r`n" h
Here's a workaround:

Code: Select all

oDict := ComObjCreate("Scripting.Dictionary")
oDict.Item("H") := "HELLO WORLD!"
oDict.Item("h") := "hello world!"
MsgBox, % oDict.Item("H") "`r`n" oDict.Item("h")
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], blue83, Lamron750, newbieforever, Portwolf, Rohwedder, TAC109, teadrinker and 67 guests