Jump to content
Sign in to follow this  
random667

variable in a variable in an .ini

Recommended Posts

can i use a variable in a variable in an .ini ?

if so, what am i doing wrong?

my.au3

$username = "jason"
$tot=IniReadSection("triggers.ini", "totaltriggers")
$totaltriggers = $tot[1][1]
$res = IniReadSection("triggers.ini", "response")
    For $i = 1 To $totaltriggers
    MsgBox(4096, "", $res[$i][1])
    Next

triggers.ini

[totaltriggers]
$Totaltriggers = 2

[triggers]

$T1 =  lol


$T2 =  rofl

[response]


$R1 = "lol, Really Funny " & $username & "!"


$R2 = "rofl?, Get up " & $username & ", you idiot!"

this is returning:

"lol, Really Funny " & $username &"!"

But, what i am trying to get is:

lol, Really Funny jason !

any ideas?


It is really sad to see a family torn apart by something as simple as a pack of wolves.

Share this post


Link to post
Share on other sites

can i use a variable in a variable in an .ini ?

if so, what am i doing wrong?

my.au3

this is returning:

"lol, Really Funny " & $username &"!"

But, what i am trying to get is:

lol, Really Funny jason !

any ideas?

<{POST_SNAPBACK}>

Set a standard set of characters in your .ini file that you can STRINGREPLACE() it with the variable of your choice.

Example, in your INI, $r = "Hello, @USER@, how are you?"

then run a check for the keywords to replace.

If StringInStr($ini,"@USER@") > 1 then StringReplace($ini,"@USER@",$username)

Edit: Syntax fix and spelling errors

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

Thank you so much!

i knew it would be something simple like this.


It is really sad to see a family torn apart by something as simple as a pack of wolves.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...