random667 Posted May 23, 2005 Share Posted May 23, 2005 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]) Nexttriggers.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. Link to comment Share on other sites More sharing options...
Blue_Drache Posted May 23, 2005 Share Posted May 23, 2005 (edited) can i use a variable in a variable in an .ini ?if so, what am i doing wrong?my.au3this 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 May 23, 2005 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
random667 Posted May 23, 2005 Author Share Posted May 23, 2005 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now