ResNullius Posted July 26, 2007 Share Posted July 26, 2007 I might have gone on thinking that because it worked for me that it was fine.Not a problem, I think that's probably something we've all done: worked hard at creating a program or function that works perfectly in our isolated environments with varying sets of data/criteria, but as soon as we let it loose in the "wild" something goes haywire. I know it's happened to me (a lot!).Thanks for the speedy response. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 26, 2007 Moderators Share Posted July 26, 2007 "idiot" proof it sometimes... we wouldn't be implying anything now would we? Ha... Not at all actually Sorry if it seemed that I was implying that. 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...
sg1kritik Posted November 9, 2007 Share Posted November 9, 2007 nice work thx for the share Link to comment Share on other sites More sharing options...
GEOSoft Posted November 9, 2007 Author Share Posted November 9, 2007 (edited) nice work thx for the shareGlad it helps you.Smoke_N and I discussed merging his and mine together but never quite got around to it. Stay tuned, it might actually happen one of these days. Edited November 9, 2007 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
GEOSoft Posted January 10, 2008 Author Share Posted January 10, 2008 (edited) Just dragging this old thread up to add another func. This allows you to copy a complete section from an Ini file into another file. I had a need to do that for creating a temporary file which was later deleted.;=============================================================================== ; Function Name: _INICopySection() ; Description: Copy a complete section of an Ini file to another file ; Syntax: _INICopySection("File Path & Name of file to copy from", "File Path & Name of file to copy to", "Section") ; Parameter(s): ; Requirements: ; Return Value(s): Copies a complete section from the input file to the output file. ; Author(s): GEOSoft ;=============================================================================== Func _INICopySection($i_File, $o_File, $i_Section) Local $I, $iArray, $oSec = "", $nFile $nFile = FileOpen($o_File, 1) If @Error Then MsgBox(4096, "Error", "Unable to open the output file") $iArray = StringSplit(StringStripCR(FileRead($i_File)), @LF) $sSec = _ArraySearch($iArray, $i_Section, 0, 0, 0, True) If $sSec = -1 Then MsgBox(4096, "Error", "Unable to locate the requested section") Return SetError(1) EndIf $eSec = _ArraySearch($iArray, '[', $sSec +1, 0, 0, True) If $eSec <> -1 Then $eSec -=1 Else $eSec = Ubound($iArray) -1 EndIf For $I = $sSec To $eSec FileWriteLine($nFile, $iArray[$I]) Next FileClose($nFile) EndFunc ;<==> _INIAddSection($i_File, $i_Section, $i_Sort = 1)I still want to get around to merging all of Smoke_Ns and Garys INI functions into a single file with mine. Hopefully soon.In the meantime my functions from this thread are available in a zip file.Ini.zip Edited January 12, 2008 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
MrCreatoR Posted January 12, 2008 Share Posted January 12, 2008 Hi GEOSoft,Really good functions... i also work a lot with inis, and i also have few my own functions to handle the ini-structure files... such as _IniSectionExists() (with $sMask/RegExp support), _IniSectioncopy() (with Replace Flag), _IniWrite/ReadEx() (for UTF-8 support), _IniWriteMidle() (write to the certain line in section, or write before/after some text-line), and few more.If i had more time, same as you, i would like to make a complete Ini_Library, collect all written functions here on the forum, and make some good UDF library... if only i had more free time  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
GEOSoft Posted January 12, 2008 Author Share Posted January 12, 2008 Hi GEOSoft,Really good functions... i also work a lot with inis, and i also have few my own functions to handle the ini-structure files... such as _IniSectionExists() (with $sMask/RegExp support), _IniSectioncopy() (with Replace Flag), _IniWrite/ReadEx() (for UTF-8 support), _IniWriteMidle() (write to the certain line in section, or write before/after some text-line), and few more.If i had more time, same as you, i would like to make a complete Ini_Library, collect all written functions here on the forum, and make some good UDF library... if only i had more free time Thanks MsCreator. I agree it's something that we have to get done. In the meantime I noticed a mistake in the header of this func So I'll edit the post now George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
GEOSoft Posted January 19, 2008 Author Share Posted January 19, 2008 Based on a question in the General Help forum I have added a couple of functions to this UDF. Also the code in the first post has been replaced with a file link. The new functions are _IniCopySection() and IniSortSectionByValue() Which will allow you to sort a section based on the key data values. I also added sort order to the functions with the default always being ascending (0). I have not added examples to the zip file yet but I hope to in the next few days. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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