Jump to content
Sign in to follow this  

Limits of IniReadSectionNames and FileReadLine

Recommended Posts

Hello everybody !

I'm trying to make a program that reads a REG file.

I tried with IniReadSectionNames to retrieve registry key names, but it doesn't read more than 568 keys...

I tried also with FileReadLine but the REG file is not readable.

Is this file too big ? What are the limitations for these functions ?

EDIT : It takes 45 seconds to open with the Notepad.

So I opened the file with AutoIt and the script waits more than 45 seconds before reading lines, but this doesn't run...

Thank you a lot for helping me !

Edited by Olish

Share this post

Link to post
Share on other sites

I know Valik put a limitation on the Section names... but I don't know anything about why FileRead is failing (unless you're using it wrong... but we wouldn't know that :hint: ).


I don't know how reliable this would be... using AutoIt 3.2 you could try this:

Local $File = FileRead(@DesktopDir & '\TEST.AU3.ini')
Local $aSNames = _SRE_BetweenEX($File, '\[', '\]')
If Not @error Then
    For $iCount = 0 To UBound($aSNames) - 1
        MsgBox(0, 'Number of Sections = ' & UBound($aSNames) - 1, _
Func _SRE_BetweenEX($s_String, $s_Start, $s_End, $iCase = 'i')
    If $iCase <> 'i' Then $iCase = ''
    $a_Array = StringRegExp($s_String, '(?' & $iCase & _
                ':' & $s_Start & ')(.*?)(?' & $iCase & _
                ':' & $s_End & ')', 3)
    If @extended & IsArray($a_Array) Then Return $a_Array
    Return SetError(1, 0, 0)    
My concern is if the values have brackets or not. Edited 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.

Share this post

Link to post
Share on other sites

I'll try this code...

Why this limitation ?

Compatibility with older versions of Windows that are supported by AutoIt.

You shouldn't be using registry functions to read a reg file, anyway. It's not exactly a standard INI file in a format understood by AutoIt. There may be subtle differences in how that file works and how AutoIt reads INI files that could cause a loss of data.

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  

  • Create New...