Author Topic: readini variable  (Read 3457 times)

0 Members and 1 Guest are viewing this topic.

Offline ReVilo

  • Wiseguy
  • **
  • Posts: 64
  • Master of All that is Holy
    • View Profile
readini variable
« on: March 30, 2008, 08:15:30 pm »
Is there a way to make a variable that is dependent on a readini? So that it has to readini to find out the value of that variable. Is this possible? (Sorry if it's not clear what I'm trying to say >_<)

Juppi

  • Guest
Re: readini variable
« Reply #1 on: March 30, 2008, 10:40:19 pm »
Yes, by using readini and writeini:

Code: [Select]
!writeini -n filename.ini LABEL value_name x    ;saves the value to filename.ini and rewrites the old one

$readini(filename.ini,LABEL,value_name)    ;returns x


The filename.ini file looks like this:

Code: [Select]
[LABEL]
value_name=x

Offline ReVilo

  • Wiseguy
  • **
  • Posts: 64
  • Master of All that is Holy
    • View Profile
Re: readini variable
« Reply #2 on: March 31, 2008, 05:35:20 am »
Hmm, I meant (cause i'm trying to make a banlist command without a constantly refreshing web host) how could I make a variable like %banlist.

Offline Mex

  • Wiseguy
  • **
  • Posts: 63
    • View Profile
Re: readini variable
« Reply #3 on: March 31, 2008, 07:15:22 pm »
If you wish to use a variable instead of plain text inside the $readini identifier, you can.
For example if your ini layout was the following:

Code: [Select]
[section]
bob=hacking

And your script was this:

Code: [Select]
var %banslist = bob
var %test = $readini(filename.ini,section,%banslist)

Then the variable called %test will contain the word "hacking".

I hope thats what your after, if not then please explain exactly what your trying to do.