Reputation:
I am trying to create an ini-database for every user that typed /boot (something). But the problem is that I cannot write to ini. I need to do that:
Write into an ini section "boots" a key with a name of value of variable bootuserid. This is what I tried:
boots.'${bootuserid}'
boots.$bootuserid
boots.${bootuserid}
boots.(bootuserid)
All the scripts failed. So how do I make an ini key name of a value of variable?
Upvotes: 3
Views: 93
Reputation: 1460
You can use bracket notation to access a variable name with another variable:
boots[bootuserid]
I.e.
a={b:1}
myvar="b"
a[myvar] //returns 1
Upvotes: 2