Sign in to follow this  
Followers 0
strate

Maximum Number Of Section In A Ini File?

15 posts in this topic

#1 ·  Posted (edited)

I have a script that was dumping data into a INI file and it keeps closing out. Currently the INI file is at 338 sections is this a max?

EDIT: By the way if this isn't the max I'm gonna be creating around 7500 sections would this be an issue?

Edited by strate

INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites



I have a script that was dumping data into a INI file and it keeps closing out. Currently the INI file is at 338 sections is this a max?

EDIT: By the way if this isn't the max I'm gonna be creating around 7500 sections would this be an issue?

I don't think that's the max, but the max size is 64kb's have you reached that?

[center]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.[/center]

Share this post


Link to post
Share on other sites

I don't think that's the max, but the max size is 64kb's have you reached that?

Size: 324 bytes (324 bytes)

Size on Disk: 4.00 KB (4,096 bytes)

So it appears thats not the problem, damn.


INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites

Size: 324 bytes (324 bytes)

Size on Disk: 4.00 KB (4,096 bytes)

So it appears thats not the problem, damn.

Are you getting some kind of error?

[center]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.[/center]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Are you getting some kind of error?

It exits properly from Beta Run in Scite no errors or anything related. I think it is associated to FindFileFirstFile-NextFile. Each file is just a excel spreadsheet with a bunch of data (BOM kinda). Then it searches for the boxes in the other file. Any matches it finds it puts in a INI file.

#include 'ExcelCom.au3'
#include 'array.au3'

$Box_List_File = 'H:\Box List.xls'
$INI_File = 'H:\Kit Box List.INI'
;~ $Kit_Number = ''

$List_Array = _XLColumnToArray ($Box_List_File, 1, "A2:A172", 1, 0); Read Box list into array

$search = FileFindFirstFile("G:\Packaging\Process Sheets\10798.xls")
While 1
    $Kit_Number = FileFindNextFile($search)
    $s_FilePath = 'G:\Packaging\Process Sheets\' & $Kit_Number
    If @error Then ExitLoop
    For $i = 1 To UBound($List_Array) - 1
        ToolTip($Kit_Number & '  ' & $List_Array[$i])
        If _XLSearch ($s_FilePath, 1, $List_Array[$i], 0) <> 'Nothing' Then; If it finds a match....
            $Section_Read = IniReadSection($INI_File, $Kit_Number)
            If @error = 1 Then; INI file or section/value doesn't exist.
                IniWrite($INI_File, $Kit_Number, 1, $List_Array[$i]); First entry into INI file, section created at the same time.
            Else; Consecutive enteries created.
                For $ii = 1 To $Section_Read[0][0]; Read each entry value of the INI under the "Kit Number/Section"
                    If $Section_Read[$ii][1] <> $List_Array[$i] Then; If the INI Value doesn't match the box then.....
                        IniWrite($INI_File, $Kit_Number, $Section_Read[0][0] + 1, $List_Array[$i]); Add Box to INI File
                    EndIf
                Next
            EndIf
        EndIf
    Next
    
    Dim $NewArray[100]
    
    #region; Read in array and turn 2 Dimensional into a 1 Dimensional
    $Array = IniReadSection($INI_File, $Kit_Number)
    If Not @error Then
;~       MsgBox(4096, "", "Error occured, probably no INI file.")
;~   Else
        For $i = 1 To $Array[0][0]
            $NewArray[$i] = $Array[$i][1]
        Next
    EndIf
    #endregion
    
    #region; Eliminates Duplicates
    Local $TempStore = ''
    For $i = 1 To UBound($NewArray) - 1
        If Not StringInStr(Chr(01) & $TempStore, Chr(01) & $NewArray[$i] & Chr(01)) Then
            $TempStore = $TempStore & $NewArray[$i] & Chr(01)
;~      MsgBox(0,'New INI','Key: '&$i&' Value: '&$NewArray[$i])
        EndIf
    Next
    
    $TempStore = StringSplit(StringTrimRight($TempStore, 1), Chr(01))
    #endregion
    
    $Blank_Entry = _ArraySearch ($TempStore, ''); Find last blank entry in the Array
    _ArrayDelete($TempStore, $Blank_Entry); Remove Blank INI entry from the Array
    IniDelete($INI_File, $Kit_Number); Delete the section/Kit number from the INI file
    #region; Update the INI file to include the new section with a entry containing the total number of boxes
    For $i = 0 To UBound($TempStore) - 1
        IniWrite($INI_File, $Kit_Number, $i, $TempStore[$i])
    Next
    #endregion
    _XLClose ($s_FilePath, 0, 0)
WEnd
FileClose($search)
Edited by strate

INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I'm only maxing out on Kb's... Try this out that I made to try and replicate it

For $i = 1 To 7500
    FileWriteLine(@DesktopDir & '\IniCheck.ini', '[' & $i & ']')
    FileWriteLine(@DesktopDir & '\IniCheck.ini', $i & '=' & $i + 1)
    If (FileGetSize(@DesktopDir & '\IniCheck.ini') / 1024) >= 64 Then 
        ExitLoop
    EndIf
Next

$a = IniReadSection(@DesktopDir & '\IniCheck.ini', '3500')
For $i = 1 To $a[0][0]
    MsgBox(0, 'Section Read Test', $a[$i][0] & @CRLF & $a[$i][1])
Next

Edit:

Hmmm....

I wonder if the ini limitations were lifted...

For $i = 1 To 7500
    FileWriteLine(@DesktopDir & '\IniCheck.ini', '[' & $i & ']')
    FileWriteLine(@DesktopDir & '\IniCheck.ini', $i & '=' & $i + 1)
    If (FileGetSize(@DesktopDir & '\IniCheck.ini') / 1024) >= 90 Then 
        ExitLoop
    EndIf
Next

$a = IniReadSection(@DesktopDir & '\IniCheck.ini', '5000')
For $i = 1 To $a[0][0]
    MsgBox(0, 'Section Read Test', $a[$i][0] & @CRLF & $a[$i][1])
Nex
That's 90kb's and over 5000 sections. Edited by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

I'm running your script and I broke the 64KB just fine. Still running.....


INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites

I have yet to encounter a limit on ini files. Though it starts to take longer to modify already entered sections and keys once you start getting a really large ini file (10MB+).


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

I have yet to encounter a limit on ini files. Though it starts to take longer to modify already entered sections and keys once you start getting a really large ini file (10MB+).

I think I read somewhere that the limitation was 64kb with pre win2k.


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

I think I read somewhere that the limitation was 64kb with pre win2k.

I can't remember and to be honest, I can't find it now...

Here are details of the current technical limits of AutoIt. Please note that some of the limits are theoretical and you may run into performance or memory related problems before you reach the actual limit.

Maximum length of a single script line: 4,095

Maximum string length: 2,147,483,647 characters

Number range (floating point): 1.7E308 to 1.7E+308 with 15-digit precision

Number range (integers): 64-bit signed integer

Hexadecimal numbers: 32-bit signed integer (0x80000000 to 0x7FFFFFFF)

Arrays: A maximum of 64 dimensions and/or a total of 16 million elements

Maximum depth of recursive function calls: 384 levels

Simultaneous open files: 64

Simultaneous active HotKeys: 64

Maximum number of variables in use at one time: No limit

Maximum number of user defined functions: No limit

Maximum number of GUI windows: 1024

Maximum number of GUI controls per window: 4096


[center]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.[/center]

Share this post


Link to post
Share on other sites

Why use a giant INI? Why not use a Database?

--Just a thought (see my signature if you wanna use MySQL)

~cdkid


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

Why use a giant INI? Why not use a Database?

--Just a thought (see my signature if you wanna use MySQL)

~cdkid

I don't want to have to worry about any other utilities needing installed.

INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites

i'm using 6mb ini-files as well for my enigma-clon, so i think there is no limitation, it's just the time you need to look through the whole file

for better performance i suggest ini-files <1mb

6 MBs!!?

Nuff how quick are they, I can't imagine not using at least Access for something that large. 6mb's... :)


[center]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.[/center]

Share this post


Link to post
Share on other sites

6 MBs!!?

Nuff how quick are they, I can't imagine not using at least Access for something that large. 6mb's... :)

its a ~630k line ini with 2551 sections - getting through 21 sections takes about 15 seconds (correct way - other way round [getting key from value] takes about 25 seconds for 21 sections - so i'd say this is quite fast :mellow:)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0