Makkhdyn Posted April 19, 2005 Share Posted April 19, 2005 Hi, I have a problem, I need to do a special concatenation, I need to create an array like this: $var= "text" dim $ & $var & [3] I need an array named text => dim $text[3] but I don't know how to do that... Can you help me ? PS: Sorry for my english, I'm french. Link to comment Share on other sites More sharing options...
Devion Posted April 19, 2005 Share Posted April 19, 2005 Hm, do you meen like dim $text[3] ? Then you can set $text[3] = "something" if i remember correct. Its been a while since i coded autoit so im not 100% sure its correct Hope it helps anyway. Link to comment Share on other sites More sharing options...
Makkhdyn Posted April 19, 2005 Author Share Posted April 19, 2005 I want to create an array whose name is a variable In my exemple the value was text but it can be anything Link to comment Share on other sites More sharing options...
andrew.arnott Posted April 19, 2005 Share Posted April 19, 2005 I am no pro with AutoIt, but I really don't think it is possible to create variable names during runtime. From the manual: "Each variable has a name (again, similar to a mailbox) and must start with the $ character and may only contain letters, numbers and the underscore _ character" No mention of other variables, so I don't think you can do it. aarnott Link to comment Share on other sites More sharing options...
Devion Posted April 19, 2005 Share Posted April 19, 2005 Ah, now i understand what you mean. You want to create a dynamic-name variable, right? I guess its not possible, because its not in most languages. Only script language i know which supports dynamic variable names is mIRCs scripting. Im not sure here either. Link to comment Share on other sites More sharing options...
Ejoc Posted April 19, 2005 Share Posted April 19, 2005 You can, or alteast you could, do it in perl, but thats not the point. The closest thing in AutoIt is Eval(), but that will not do what you want it to do, so for now you are SOL. Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs Link to comment Share on other sites More sharing options...
Devion Posted April 19, 2005 Share Posted April 19, 2005 It would, indeed, be nice with dynamic variables sometimes, but its more often confusing then useful. At least thats what i remember from my time with mIRC-scripting. Sorry we couldnt help out here Link to comment Share on other sites More sharing options...
zcoacoaz Posted April 19, 2005 Share Posted April 19, 2005 (edited) Actually its really simple #include <array.au3> $var= "text" Assign ( $var, _ArrayCreate ( "", "", "" ) ) edit: the max size of an array declared like this is 27. Edited April 19, 2005 by Xenogis [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font] Link to comment Share on other sites More sharing options...
Makkhdyn Posted April 20, 2005 Author Share Posted April 20, 2005 (edited) Thanks but my problem is i need the name of the array to add elements: $sections = IniReadSectionNames ("config.ini") For $i = 1 To $sections[0] $sectioni = IniReadSection("config.ini", $sections[$i]) $title=$sections[$i] Assign ( $sections[$i], _ArrayCreate ("") ) For $j = 1 To $sectioni[0][0] $z = $sectioni[$j][0] _ArrayAdd( $Eval($sections[$i]), $z);here!! Next Next Edited April 20, 2005 by Makkhdyn Link to comment Share on other sites More sharing options...
quick_sliver007 Posted April 20, 2005 Share Posted April 20, 2005 (edited) **edit** Edited April 20, 2005 by quick_sliver007 . Link to comment Share on other sites More sharing options...
andrew.arnott Posted April 20, 2005 Share Posted April 20, 2005 Have you considered a 3-D array? I think this might be what you are asking: $sections = IniReadSectionNames ("config.ini") For $i = 1 To $sections[0] $section[$i] = IniReadSection("config.ini", $sections[$i]) $title=$sections[$i] Assign ( $sections[$i], _ArrayCreate ("") ) For $j = 1 To $section[$i][0][0] $z = $section[$i][$j][0] _ArrayAdd( $Eval($sections[$i]), $z);here!! Next Next That should have the same effect as what you were asking. But maybe I don't understand the question after all. Link to comment Share on other sites More sharing options...
Greenseed Posted May 1, 2005 Share Posted May 1, 2005 salut je parle francais je crois bien avoir compris se que tu veux dire et c'est impossible tu ne peux pas mettre variable le nom d'une variable mais peu-etre si tu me disais pourquoi je pourais t'aider plus bye bye GreenseedMCSE+I, CCNA, A+Canada, QuebecMake Love Around You. 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