; Example Data: aB = Name 1 bF = Name 2 AB = Name 3 MsgBox, %aB% %bF% %AB% ; Displays Name 3 Name 2 Name 3Thanks!

Case sensitive variables possible?

I suspect that if you do up a couple of function to assign and get contents to/from a variable, and pass the var name as a parameter (possibly byref?), that maybe you could change the internal storage representation of the variable name to it's ASCII equiv:
i.e. var name aB could become V_9766 and var name AB could become V_6566?
Just a thought of how I might attempt to approach that...
-t

sd := ComObjCreate("Scripting.Dictionary") sd.item("aB") := "Name 1" sd.item("AB") := "Name 3" MsgBox, % sd.item("aB") "`n" sd.item("AB")
:wink: - case sensitive keysMore importantly, what can Scripting.Dictionary do that the built-in objects can't do?

StringCaseSense, On ;would technically solve that problem for you.

The universe is a wondrous place! The faster you create unbreakable code, the faster the universe creates people that can break it. All scripting follows the rule Rule Of Twos -- 1) Good, 2) Fast 3) Cheap -- pick any Two.
I guarantee absolutely nothing about any code I provide except that it works in my machine. ●
MMO Fighter KeyLooperDemo Key Spammer TinyClickRecorder GGs Password Generator.ahk
For the newest version of AutoHotkey and some killer scripts go here.


The universe is a wondrous place! The faster you create unbreakable code, the faster the universe creates people that can break it. All scripting follows the rule Rule Of Twos -- 1) Good, 2) Fast 3) Cheap -- pick any Two.
I guarantee absolutely nothing about any code I provide except that it works in my machine. ●
MMO Fighter KeyLooperDemo Key Spammer TinyClickRecorder GGs Password Generator.ahk
For the newest version of AutoHotkey and some killer scripts go here.
ie
var(,"a","Contents of var a") var(,"A","Contents of var A") Msgbox % var(1, "a") Msgbox % var(1, "A") Var(action=0, variable="", content=""){ Static If !action ;Store value { Count++ Var%Count% := variable "_" content } else if action = 1 ;Retrieve value { Retrieved = Loop % Count { if (SubStr(Var%A_Index%, 1, InStr(Var%A_Index%,"_")-1) == variable) { Retrieved := SubStr(Var%A_Index%, InStr(Var%A_Index%,"_")+1) return Retrieved } } } }
However, I'm fairly sure it would be impossible (or very difficult) to initialize a variable through AHK normally and be able to tell the original case.

If you told us the reason behind needing this, maybe we can approach this from a completely different angle and solve it with some other method.

I love my wife, my life, my atomic-match; for giving me the greatest gift a man could ask for, such a perfect and beautiful little girl.

I think your problem is exactly the same as mine. Here is my full test code (including the two solutions tested, which both work fine) :
#w:: a1 := "ae" a2 := "AE" sd := ComObjCreate("Scripting.Dictionary") sd.item(a1) := "æ" sd.item(a2) := "Æ" MsgBox, % sd.item(a1) "`n" sd.item(a2) array := CSobj() array[a1] := "æ" array[a2] := "Æ" MsgBox, % array["ae"] "`n" array["AE"] for k,v in array t .= k " : " v "`n" MsgBox, %t% CSobj() { static base := object("_NewEnum","__NewEnum", "Next","__Next", "__Set","__Setter", "__Get","__Getter") return, object("__sd_obj__", ComObjCreate("Scripting.Dictionary"), "base", base) } __Getter(self, key) { return, self.__sd_obj__.item(key) } __Setter(self, key, value) { self.__sd_obj__.item(key) := value return, false } __NewEnum(self) { return, self } __Next(self, ByRef key = "", ByRef val = "") { static Enum if not Enum Enum := self.__sd_obj__._NewEnum if Not Enum[key], val:=self[key] return, Enum:=false return, true } return

Here's an example of my code:
Output = %A_ScriptDir%\Output.csv XMLFile = %A_ScriptDir%\Input.xml CodeCount = 0 Loop, read, %XMLFile% { IfInString, A_LoopReadLine, <item name= IfInString, A_LoopReadLine, type="type" { RegExMatch(A_LoopReadLine, "(?<=name="")\w+", Name) RegExMatch(A_LoopReadLine, "(?<=code="")\w+", Code) } If (Name and Code) { IfNotInString, A_LoopReadLine, </item> ; Not reached end of Item, continue { IfInString, A_LoopReadLine, <next> ; Next Code RegExMatch(A_LoopReadLine, "(?<=\<next\>)\w+", NextCode) } Else { If (Name and Code and NextCode) { CodeCount += 1 NameList%CodeCount% := Name CodeList%CodeCount% := NextCode name%Code% := Name } Name = 0 NextCode = 0 } } } Loop, %CodeCount% ; Output to CSV { iName := NameList%A_Index% iNextCode := CodeList%A_Index% iNextName := name%iNextCode% FileAppend, %iName%`,%iNextName%`n, %Output% }Problem is name%Code% creates several variables which are case sensitive (because the items in the XML are case sensitive). Maybe there is a different way to do this that bypasses the whole case sensitivity issue?

As stated above, you could use a scripting.dictionary object (example uses AutoHotkey_L, but could easily be modified for AHK Basic):Problem is name%Code% creates several variables which are case sensitive
Output = %A_ScriptDir%\Output.csv XMLFile = %A_ScriptDir%\Input.xml CodeCount = 0 [color=darkred]name := ComObjCreate("Scripting.Dictionary")[/color] ; .................... ; name%Code% := Name [color=darkred]name.item(Code) := Name[/color] } Name = 0 NextCode = 0 } } } Loop, %CodeCount% ; Output to CSV { iName := NameList%A_Index% iNextCode := CodeList%A_Index% ; iNextName := name%iNextCode% [color=darkred]iNextName := name.item(iNextCode)[/color] FileAppend, %iName%`,%iNextName%`n, %Output% }

; name%Code% := Name
name.item(Code) := Name
or, if you use the "long" version, the one a4u wrote for me in the post I mentioned, then you would have the syntax :
name[code=auto:0] := Name
Which is fine.
You have just to paste the functions in the beginning of your code.
