gcue Posted January 3, 2009 Share Posted January 3, 2009 im trying to copy all the values (not keys) from an INI section here's what i got.... how can i append in the for next loop to a variable then in the end id set data to the clipboard? $assets=IniReadSection("test.ini", "test") For $i = 1 To $assets[0][0] ?? Next _ClipBoard_SetData($var) Link to comment Share on other sites More sharing options...
Achilles Posted January 3, 2009 Share Posted January 3, 2009 im trying to copy all the values (not keys) from an INI section here's what i got.... how can i append in the for next loop to a variable then in the end id set data to the clipboard? $assets=IniReadSection("test.ini", "test") For $i = 1 To $assets[0][0] ?? Next _ClipBoard_SetData($var) $var = '' For $i = 1 to $assets[0][0] $var &= $assets[$i][0] & @CRLF; the "@CRLF" is optional, depends on what you want Next _ClipBoard_SetData($var) That work? My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
gcue Posted January 3, 2009 Author Share Posted January 3, 2009 brilliant!!! works perfectly many thanks! Link to comment Share on other sites More sharing options...
boji Posted January 26, 2009 Share Posted January 26, 2009 I do see that a answer was provided for you, but for the sake of us noobs, can you explain a bit more what these lines are doing to the information and how the suggestion fixed your problem? Thanks. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 26, 2009 Share Posted January 26, 2009 I do see that a answer was provided for you, but for the sake of us noobs, can you explain a bit more what these lines are doing to the information and how the suggestion fixed your problem? Thanks.The code posted loops through the array and assembles a single string containing all the value names, then it puts that string in the clipboard. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Authenticity Posted January 26, 2009 Share Posted January 26, 2009 $var = '' For $i = 1 to $assets[0][0] $var &= $assets[$i][0] & @CRLF; the "@CRLF" is optional, depends on what you want Next _ClipBoard_SetData($var) Reading the help file about the function IniReadSection give in-detailed explanation that if the function end successfully then the return value is a 2D array which it's first subscript (i.e, $arrIni[0][0]) is equal to the number of keys that was copied to the array which each key has a value (whether defined or not). After the variable that is going to hold the whole string is initialized the script preform loop from the first key to the last one. The line "$var &= $assets[$i][0]" is equivalent to "$var = $var & $assets[$i][0]" this line process each key (and not it's value) in the set and concatenating it's name as string to variable $var, lol I feel like it's useless so I'll stop here as it's the base and a few reading in the help file or the FAQ thread may clear things much better than I do... 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