I am a nooby in ahk and in programming generally, also in forum usage. I made this snippet of code which works but irritates me because I know there's a better way of doing it.
I'm wondering if somebody could help me...
Code: Select all
If Instr(sectionkey.2,".") { ; If the value looks like a reference to an existing object....
For key4 in StrSplit(sectionkey.2,".") {
vvv%A_Index% := StrSplit(sectionkey.2,".")[A_Index] ; parse out the reference so we can find it.
}
Try { ; We're going to go seven deep. I know there is a better way of doing this, but I haven't been able to figure it out...
%val%[(sectionkey.1)] := %vvv1%[(vvv2)]
? %vvv1%[(vvv2)]
: %val%[(sectionkey.1)]
%val%[(sectionkey.1)] := %vvv1%[(vvv2),(vvv3)]
? %vvv1%[(vvv2),(vvv3)]
: %val%[(sectionkey.1)]
%val%[(sectionkey.1)] := %vvv1%[(vvv2),(vvv3),(vvv4)]
? %vvv1%[(vvv2),(vvv3),(vvv4)]
: %val%[(sectionkey.1)]
%val%[(sectionkey.1)] := %vvv1%[(vvv2),(vvv3),(vvv4),(vvv5)]
? %vvv1%[(vvv2),(vvv3),(vvv4),(vvv5)]
: %val%[(sectionkey.1)]
%val%[(sectionkey.1)] := %vvv1%[(vvv2),(vvv3),(vvv4),(vvv5),(vvv6)]
? %vvv1%[(vvv2),(vvv3),(vvv4),(vvv5),(vvv6)]
: %val%[(sectionkey.1)]
%val%[(sectionkey.1)] := %vvv1%[(vvv2),(vvv3),(vvv4),(vvv5),(vvv6),(vvv7)]
? %vvv1%[(vvv2),(vvv3),(vvv4),(vvv5),(vvv6),(vvv7)]
: %val%[(sectionkey.1)]
}
}
For example:
Code: Select all
[Path]
need = \\172.25.2.2\Settings\Backup\OOP\ControlFiles\
log = path.need
Could anybody help me with this multi-dimensional key stuff?