Fabry Posted July 22, 2007 Share Posted July 22, 2007 in inireadsection by gafrostthere is an error, it read oly last section. I fix it: Func _IniReadSection($FileName, $Section) Local $INIContents, $PosSection, $PosEndSection, $sContents, $Value, $Found $INIContents = FileRead($FileName) If @error Then Return SetError(@error, @error, @error) ;Find section $PosSection = StringInStr($INIContents, "[" & $Section & "]") If $PosSection > 0 Then ;Section exists. Find end of section $PosEndSection = StringInStr(StringMid($INIContents, $PosSection + 1), "[") + ($PosSection - 2) ;?Is this last section? If $PosEndSection = 0 Then $PosEndSection = StringLen($INIContents) + 1 Local $INISection = StringSplit(StringMid($INIContents, $PosSection, $PosEndSection-$PosSection), @CRLF) Local $a_Section[1][2] For $x = 2 To UBound($INISection) - 1 $INISection[$x] = StringReplace($INISection[$x], @CRLF, "") If StringLen($INISection[$x]) Then ReDim $a_Section[UBound($a_Section) + 1][2] $a_Section[0][0] += 1 Local $PosSep = StringInStr($INISection[$x], "=") If Not $PosSep Then Return SetError(-1,-1,-1) $a_Section[UBound($a_Section) - 1][0] = StringMid($INISection[$x], 1, $PosSep - 1) $a_Section[UBound($a_Section) - 1][1] = StringMid($INISection[$x], $PosSep + 1) EndIf Next Return $a_Section EndIf Return SetError(-1, -1, "") EndFunc ;==>_IniReadSection Check it I'm not sure. A lan chat (Multilanguage)LanMuleFile transferTank gameTank 2 an online game[center]L'esperienza รจ il nome che tutti danno ai propri errori.Experience is the name everyone gives to their mistakes.Oscar Wilde[/center] Link to comment Share on other sites More sharing options...
RazerM Posted July 26, 2007 Share Posted July 26, 2007 (edited) This bug is evident in all your Ini functions SmOke_N, you return IniReadSection (if lower than 32kb) without setting its error and extended value. Edit: Added comments to show added/changed lines Func _IniReadSectionEx($hFile, $vSection) Local $iSize = FileGetSize($hFile) / 1024 Local $aSection = IniReadSection($hFile, $vSection) ;ADDED - Call func and get return If $iSize <= 31 Then Return SetError(@error, @extended, $aSection) ;CHANGED - set error and extended values, return $aSection Local $sFRead = @CRLF & FileRead($hFile) & @CRLF & '[' $vSection = StringStripWS($vSection, 7) Local $aData = StringRegExp($sFRead, '(?s)(?i)\n\s*\[\s*' & $vSection & '\s*\]\s*\r\n(.*?)\[', 3) If IsArray($aData) = 0 Then Return SetError(1, 0, 0) Local $aKey = StringRegExp(@LF & $aData[0], '\n\s*(.*?)\s*=', 3) Local $aValue = StringRegExp(@LF & $aData[0], '\n\s*.*?\s*=(.*?)\r', 3) Local $nUbound = UBound($aKey) Local $aSection[$nUBound +1][$nUBound +1] $aSection[0][0] = $nUBound For $iCC = 0 To $nUBound - 1 $aSection[$iCC + 1][0] = $aKey[$iCC] $aSection[$iCC + 1][1] = $aValue[$iCC] Next Return $aSection EndFunc Edited July 26, 2007 by RazerM My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 26, 2007 Author Moderators Share Posted July 26, 2007 This bug is evident in all your Ini functions SmOke_N, you return IniReadSection (if lower than 32kb) without setting its error and extended value. Edit: Added comments to show added/changed lines Func _IniReadSectionEx($hFile, $vSection) Local $iSize = FileGetSize($hFile) / 1024 Local $aSection = IniReadSection($hFile, $vSection) ;ADDED - Call func and get return If $iSize <= 31 Then Return SetError(@error, @extended, $aSection) ;CHANGED - set error and extended values, return $aSection Local $sFRead = @CRLF & FileRead($hFile) & @CRLF & '[' $vSection = StringStripWS($vSection, 7) Local $aData = StringRegExp($sFRead, '(?s)(?i)\n\s*\[\s*' & $vSection & '\s*\]\s*\r\n(.*?)\[', 3) If IsArray($aData) = 0 Then Return SetError(1, 0, 0) Local $aKey = StringRegExp(@LF & $aData[0], '\n\s*(.*?)\s*=', 3) Local $aValue = StringRegExp(@LF & $aData[0], '\n\s*.*?\s*=(.*?)\r', 3) Local $nUbound = UBound($aKey) Local $aSection[$nUBound +1][$nUBound +1] $aSection[0][0] = $nUBound For $iCC = 0 To $nUBound - 1 $aSection[$iCC + 1][0] = $aKey[$iCC] $aSection[$iCC + 1][1] = $aValue[$iCC] Next Return $aSection EndFuncGood point, thanks... I'll fix them as soon as I can find the time today. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 3, 2007 Author Moderators Share Posted November 3, 2007 (edited) Per RazerM's suggestion (just a tad late fixing these), each of the functions do not have an error flag thrown though as he suggested, so I only fixed those that did. Pasting all of them in this post so I don't have to keep back referencing them. expandcollapse popupFunc _IniDeleteEx($hFile, $vSection, $vKey = '') Local $iSize = FileGetSize($hFile) / 1024 If $iSize <= 31 Then Return IniDelete($hFile, $vSection, $vKey) Local $sString = FileRead($hFile) Local $sFRead = @CRLF & $sString & @CRLF & '[' $vSection = StringStripWS($vSection, 7) Local $aData = StringRegExp($sFRead, '(?s)(?i)\n\s*\[\s*' & $vSection & '\s*\]\s*\r\n(.*?)\[', 3) If IsArray($aData) = 0 Then Return SetError(1, 0, 0) $aData[0] = StringRegExpReplace($aData[0], '(\r\n)+$', '') If $vKey = '' Then $sString = StringRegExpReplace($sString, '(?s)(?i)(^|\n)\s*\[\s*' & $vSection & '\s*\]\s*(\r\n)+' & StringReplace($aData[0], '\', '\\'), @LF & @CRLF) Else $sString = StringRegExpReplace($aData[0], '(?s)(?i)\n\s*' & $vKey & '\s*=.*?(?m:\r\n|$)', @LF) EndIf $sString = StringRegExpReplace($sString, '(^(\r\n)+)+|^\r+|^\n+|(\r\n)+$|\[$', '') $sString = StringRegExpReplace($sString, '(\r\n){3}', @CRLF) $sString = StringRegExpReplace($sString, '(^(\r\n)+)+', '') FileClose(FileOpen($hFile, 2)) Return FileWrite($hFile, $sString) EndFunc Func _IniWriteEx($hFile, $vSection, $vKey, $vValue) If FileExists($hFile) = 0 Then FileClose(FileOpen($hFile, 2)) Local $iSize = FileGetSize($hFile) / 1024 If $iSize <= 31 Then Return IniWrite($hFile, $vSection, $vKey, $vValue) Local $sString = FileRead($hFile) Local $sFRead = @CRLF & $sString & @CRLF & '[' $vSection = StringStripWS($vSection, 7) Local $aData = StringRegExp($sFRead, '(?s)(?i)\n\s*\[\s*' & $vSection & '\s*\]\s*\r\n(.*?)\[', 3) If IsArray($aData) = 0 Then If StringRegExp($sString, '(?s)\r\n$') = 0 Then $sString &= @CRLF & '[' & $vSection & ']' & @CRLF & $vKey & '=' & $vValue Else $sString &= '[' & $vSection & ']' & @CRLF & $vKey & '=' & $vValue EndIf FileClose(FileOpen($hFile, 2)) Return FileWrite($hFile, $sString) EndIf $aData[0] = StringRegExpReplace($aData[0], '(\r\n)+$', '') If StringRegExp(@LF & $aData[0] & @CRLF, '(?s)(?i)\n\s*' & $vKey & '\s*=') Then Local $sTempReplace = StringRegExpReplace(@LF & $aData[0] & @CR, _ '(?s)(?i)\n\s*' & $vKey & '=.*?\r', @LF & $vKey & '=' & StringReplace($vValue, '\', '\\') & @CR) $aData[0] = StringRegExpReplace($sTempReplace, '^\r\n|^\s*\n|^\s*\r|\r$', '') Else $aData[0] = StringReplace($aData[0] & @CRLF & $vKey & '=' & $vValue, '\', '\\') EndIf $sString = StringRegExpReplace(@LF & $sString & _ '[', '(?s)(?i)(^|\n)\s*\[\s*' & $vSection & '\s*\]\s*\r\n.*?\s*\[', @LF & @CRLF & '\[' & $vSection & '\]' & @CRLF & $aData[0] & @CRLF & @CRLF & '\[') $sString = StringRegExpReplace($sString, '(^(\r\n)+)+|^\r+|^\n+|\[$|(\r\n)+$', '') FileClose(FileOpen($hFile, 2)) Return FileWrite($hFile, $sString) EndFunc Func _IniReadSectionNamesEx($hFile) Local $iSize = FileGetSize($hFile) / 1024 If $iSize <= 31 Then Local $aNameRead = IniReadSectionNames($hFile) If @error Then Return SetError(@error, 0, '') Return $aNameRead EndIf Local $aSectionNames = StringRegExp(@CRLF & FileRead($hFile) & @CRLF, '(?s)\n\s*\[(.*?)\]s*\r', 3) If IsArray($aSectionNames) = 0 Then Return SetError(1, 0, 0) Local $nUbound = UBound($aSectionNames) Local $aNameReturn[$nUbound + 1] $aNameReturn[0] = $nUbound For $iCC = 0 To $nUBound - 1 $aNameReturn[$iCC + 1] = $aSectionNames[$iCC] Next Return $aNameReturn EndFunc Func _IniReadSectionEx($hFile, $vSection) Local $iSize = FileGetSize($hFile) / 1024 If $iSize <= 31 Then Local $aSecRead = IniReadSection($hFile, $vSection) If @error Then Return SetError(@error, 0, '') Return $aSecRead EndIf Local $sFRead = @CRLF & FileRead($hFile) & @CRLF & '[' $vSection = StringStripWS($vSection, 7) Local $aData = StringRegExp($sFRead, '(?s)(?i)\n\s*\[\s*' & $vSection & '\s*\]\s*\r\n(.*?)\[', 3) If IsArray($aData) = 0 Then Return SetError(1, 0, 0) Local $aKey = StringRegExp(@LF & $aData[0], '\n\s*(.*?)\s*=', 3) Local $aValue = StringRegExp(@LF & $aData[0], '\n\s*.*?\s*=(.*?)\r', 3) Local $nUbound = UBound($aKey) Local $aSection[$nUBound +1][2] $aSection[0][0] = $nUBound For $iCC = 0 To $nUBound - 1 $aSection[$iCC + 1][0] = $aKey[$iCC] $aSection[$iCC + 1][1] = $aValue[$iCC] Next Return $aSection EndFunc Func _IniReadEx($hFile, $vSection, $vKey, $vDefault = -1) If $vDefault = -1 Or $vDefault = Default Then $vDefault = '' Local $iSize = FileGetSize($hFile) / 1024 If $iSize <= 31 Then Return IniRead($hFile, $vSection, $vKey, $vDefault) Local $sFRead = @CRLF & FileRead($hFile) & @CRLF & '[' $vSection = StringStripWS($vSection, 7) Local $aData = StringRegExp($sFRead, '(?s)(?i)\n\s*\[\s*' & $vSection & '\s*\]\s*\r\n(.*?)\[', 3) If IsArray($aData) = 0 Then Return SetError(1, 0, 0) Local $aRead = StringRegExp(@LF & $aData[0], '(?s)(?i)\n\s*' & $vKey & '\s*=(.*?)\r', 1) If IsArray($aRead) = 0 Then Return SetError(2, 0, 0) Return $aRead[0] EndFunc Edited September 10, 2009 by SmOke_N Updated malformed code from forum upgrade Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
therks Posted November 9, 2007 Share Posted November 9, 2007 Smoke, I have a complaint with your _IniReadEx, what if I wanted the default value to actually be -1? Could I suggest you set the default value of the parameter to Default? Func _IniReadEx($hFile, $vSection, $vKey, $vDefault = Default) If $vDefault = Default Then $vDefault = '' ... My AutoIt Stuffย | My Github Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 29, 2007 Author Moderators Share Posted November 29, 2007 Smoke, I have a complaint with your _IniReadEx, what if I wanted the default value to actually be -1? Could I suggest you set the default value of the parameter to Default? Func _IniReadEx($hFile, $vSection, $vKey, $vDefault = Default) If $vDefault = Default Then $vDefault = '' ...I could take it out completely, but since they are not released UDFs in the AutoIt download wouldn't it make more since not to complain about anything and just change it to the way you want it yourself? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
jennico Posted June 15, 2008 Share Posted June 15, 2008 @smoke: sorry for late posting. i am really amazed about the speed of your functions, the inireadsectionex is much faster than the built-in inireadsection, and much much much faster than just iniread !!! now i prefer to use inireadsectionex to iniread ! ok, but the "=" bug reoccured, at least i found it in inireadsectionex. it does not handle a "=" in value correctly. this was driving me crazy until i found it out. will have to work with stringreplace meanwhile. maybe you feel like fixing it. j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 ย Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 15, 2008 Author Moderators Share Posted June 15, 2008 (edited) @smoke:sorry for late posting.i am really amazed about the speed of your functions, the inireadsectionex is much faster than the built-in inireadsection, and much much much faster than just iniread !!! now i prefer to use inireadsectionex to iniread !ok, but the "=" bug reoccured, at least i found it in inireadsectionex. it does not handle a "=" in value correctly. this was driving me crazy until i found it out. will have to work with stringreplace meanwhile.maybe you feel like fixing it.j.I don't know if I can believe that they are faster than the built in function(s)... but I haven't timed stamped them to see.Edit:I don't know what you mean by "=" not behaving correctly, can you post an example script along with an example ini that re-creates the issue? Edited June 15, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
jennico Posted July 10, 2008 Share Posted July 10, 2008 (edited) what i mean is that _inireadsection returns wrong results if any value contains a "=" . but maybe this cannot be fixed. meanwhile i encountered another problem with "[" and "]" in keys and/or values. in order to use your _inireadsection one has to stringeplace all " = [ ] " when writing the ini. in my script "FreeStyle" (linked in my signature) i use your _inireadsection in a different way. due to the large inis (more than 6000 keys), i cannot create a 2-dimensional array, instead i return two one-dimensionals: Func _IniReadSection($x,$y,ByRef $i_key,ByRef $i_val) $t=StringRegExp(@CRLF&FileRead($x)&@CRLF&"[","(?s)(?i)\n\s*\[\s*"&$y&"\s*\]\s*\r\n(.*?)\[",3) $Key=StringRegExp(@LF&$t[0],"\n\s*(.*?)\s*=",3) $Val=StringRegExp(@LF&$t[0],"\n\s*.*?\s*=(.*?)\r",3 Dim $t=UBound($Key),$i_key[$t+1],$i_val[$t+1] $i_key[0]=$t $i_val[0]=$t For $i=0 To $t-1 $i_key[$i+1]=$Key[$i] $i_val[$i+1]=$Val[$i] Next EndFuncoรรท ร)รญ+0k,ยจยนรยง{yรazXยฆรรฃM4z{kรซ8รM1รฃM4 again, thank you for your work! j. Edited July 10, 2008 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 ย Link to comment Share on other sites More sharing options...
stamandster Posted February 27, 2009 Share Posted February 27, 2009 I don't know how to do this with RegEx but I added the ability to leave commented lines out... Func _IniReadSectionEx($hFile, $vSection) Local $iSize = FileGetSize($hFile) / 1024 If $iSize <= 31 Then Local $aSecRead = IniReadSection($hFile, $vSection) If @error Then Return SetError(@error, 0, '') Return $aSecRead EndIf Local $sFRead = @CRLF & FileRead($hFile) & @CRLF & '[' $vSection = StringStripWS($vSection, 7) Local $aData = StringRegExp($sFRead, '(?s)(?i)\n\s*\[\s*' & $vSection & '\s*\]\s*\r\n(.*?)\[', 3) If IsArray($aData) = 0 Then Return SetError(1, 0, 0) Local $aKey = StringRegExp(@LF & $aData[0], '\n\s*(.*?)\s*=', 3) Local $aValue = StringRegExp(@LF & $aData[0], '\n\s*.*?\s*=(.*?)\r', 3) Local $nUbound = UBound($aKey) Local $aSection[$nUBound +1][$nUBound +1] $aSection[0][0] = $nUBound For $iCC = 0 To $nUBound - 1 Select Case StringLeft($aKey[$iCC],1) <> ";" $aSection[$iCC + 1][0] = $aKey[$iCC] $aSection[$iCC + 1][1] = $aValue[$iCC] EndSelect Next Return $aSection EndFunc I'm trying to figure out a way to make it so that if the value is has a backslash at the very end of the line it will go to the next line and read that as well. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 10, 2009 Author Moderators Share Posted September 10, 2009 Updated malformed code caused by forum update in post #24, also added that code to first post. Fixed error in IniReadSectionEx(), creating 2nd dimension, it was using the wrong index total. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
sunafter Posted September 12, 2009 Share Posted September 12, 2009 good work!! Link to comment Share on other sites More sharing options...
danlemire Posted September 25, 2009 Share Posted September 25, 2009 (edited) Having taken the bit from kickarse, I've added a bit to the section header regex so that if you have an occurrence of '[' inside that section it will keep going until an occurence of '@CRLF[' Taking the regex from (?s)(?i)\n\s*\[\s*' & $vSection & '\s*\]\s*\r\n(.*?)[ to (?s)(?i)\n\s*\[\s*' & $vSection & '\s*\]\s*\r\n(.*?)\r\n\[ Thanks for the function, I was in desperate need of going beyond the 32768 boundary with IniReadSection, and now I can leave it better than I found it. Func _IniReadSectionEx($hFile, $vSection) Local $iSize = FileGetSize($hFile) / 1024 If $iSize <= 31 Then Local $aSecRead = IniReadSection($hFile, $vSection) If @error Then Return SetError(@error, 0, '') Return $aSecRead EndIf Local $sFRead = @CRLF & FileRead($hFile) & @CRLF & '[' $vSection = StringStripWS($vSection, 7) Local $aData = StringRegExp($sFRead, '(?s)(?i)\n\s*\[\s*' & $vSection & '\s*\]\s*\r\n(.*?)\r\n\[', 3) If IsArray($aData) = 0 Then Return SetError(1, 0, 0) Local $aKey = StringRegExp(@LF & $aData[0], '\n\s*(.*?)\s*=', 3) Local $aValue = StringRegExp(@LF & $aData[0], '\n\s*.*?\s*=(.*?)\r', 3) Local $nUbound = UBound($aKey) Local $aSection[$nUBound +1][$nUBound +1] $aSection[0][0] = $nUBound For $iCC = 0 To $nUBound - 1 Select Case StringLeft($aKey[$iCC],1) <> ";" $aSection[$iCC + 1][0] = $aKey[$iCC] $aSection[$iCC + 1][1] = $aValue[$iCC] EndSelect Next Return $aSection EndFunc Edited September 25, 2009 by danlemire Link to comment Share on other sites More sharing options...
engine Posted September 26, 2009 Share Posted September 26, 2009 This is just what I was looking for. Thanks. My contributions:Local account UDF Registry UDFs DriverSigning UDF Windows Services UDF [url="http://www.autoitscript.com/forum/index.php?showtopic=81880"][/url] Link to comment Share on other sites More sharing options...
john123 Posted December 28, 2009 Share Posted December 28, 2009 (edited) Hello everyone! I use _IniReadSectionEx() but get error : Array variable has incorrect number of subscripts or subscript dimension range exceeded. Please help me fix it. This take me two days but without success. Thanks for your help! Edited December 29, 2009 by john123 Link to comment Share on other sites More sharing options...
MadBoy Posted April 12, 2010 Share Posted April 12, 2010 (edited) Hello everyone! I use _IniReadSectionEx() but get error : Array variable has incorrect number of subscripts or subscript dimension range exceeded. Please help me fix it. This take me two days but without success. Thanks for your help! I do have the same problem. Anyone else have this? I've managed to find the problem. It occurs for this file section: [version] Signature = "$Chicago$" Compatible = 1 Class = Net ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} Provider = %Realtek% ;; CatalogFile.NT = net8192se.cat ;; for WHQL certified DriverVer = 12/30/2009,1085.23.1230.2009 When it tried to read DriverVer = 12/30/2009,1085.23.1230.2009 it fails. I'm sure there are more errors on other files but this is the first one i found. Edited April 12, 2010 by MadBoy My little company:ย Evotecย (PL version: Evotec) Link to comment Share on other sites More sharing options...
stamandster Posted December 22, 2010 Share Posted December 22, 2010 (edited) I do have the same problem. Anyone else have this? I've managed to find the problem. It occurs for this file section:When it tried to read DriverVer = 12/30/2009,1085.23.1230.2009 it fails. I'm sure there are more errors on other files but this is the first one i found.I just tested and I don't have any issues displaying this section using the function. Are you positive that it's this exact section that's having the problem? Edited December 22, 2010 by kickarse Link to comment Share on other sites More sharing options...
stamandster Posted February 24, 2011 Share Posted February 24, 2011 Fixed issue with bombing of Array exceeding limits. The Columns would match the Row and with a really large section it would kill it. I don't know if it'll fix it for everyone though. Func _IniReadSectionEx($hFile, $vSection) Local $iSize = FileGetSize($hFile) / 1024 If $iSize <= 31 Then Local $aSecRead = IniReadSection($hFile, $vSection) If @error Then Return SetError(@error, 0, '') Return $aSecRead EndIf Local $sFRead = @CRLF & FileRead($hFile) & @CRLF & '[' $vSection = StringStripWS($vSection, 7) Local $aData = StringRegExp($sFRead, '(?s)(?i)\n\s*\[\s*' & $vSection & '\s*\]\s*\r\n(.*?)\r\n\[', 3) If IsArray($aData) = 0 Then Return SetError(1, 0, 0) Local $aKey = StringRegExp(@LF & $aData[0], '\n\s*(.*?)\s*=', 3) Local $aValue = StringRegExp(@LF & $aData[0], '\n\s*.*?\s*=(.*?)\r', 3) Local $nUbound = UBound($aKey) Local $aSection[$nUBound +1][2] $aSection[0][0] = $nUBound For $iCC = 0 To $nUBound - 1 Select Case StringLeft($aKey[$iCC],1) <> ";" $aSection[$iCC + 1][0] = $aKey[$iCC] $aSection[$iCC + 1][1] = $aValue[$iCC] EndSelect Next Return $aSection EndFunc Link to comment Share on other sites More sharing options...
stamandster Posted February 28, 2011 Share Posted February 28, 2011 (edited) ... Edited February 28, 2011 by kickarse Link to comment Share on other sites More sharing options...
llewxam Posted May 15, 2011 Share Posted May 15, 2011 SmOke_N's and kickarse's both contain a bug - $aValue may not always be an array, I would advise modifying it to: If IsArray($aValue) Then $aSection[$iCC + 1][1] = $aValue[$iCC] Ian My projects: IP Scannerย - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniffย - Great technicians tool - a tool which scansย DriverPacksย archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3ย (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Toolย - Folder sync tool with lots of real time information and several checking methods. USMT Front Endย - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Toolย - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewerย - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStatย - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Gameย - My version of 2048, fun tile game. Juice Labย - Ecigarette liquid making calculator. Data Protectorย - Secure notes to save sensitive information. VHD Footerย - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in Fileย - Searches files containing a specified phrase. 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