Sign in to follow this  
Followers 0
Olish

Limits of IniReadSectionNames and FileReadLine

5 posts in this topic

#1 ·  Posted (edited)

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

Olivier, from France.Free Wake On LAN script

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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: ).

Edit:

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, _
            $aSNames[$iCount])
    Next
EndIf
    
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)    
EndFunc
My concern is if the values have brackets or not. 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 know Valik put a limitation on the Section names...

I'll try this code...

Why this limitation ?


Olivier, from France.Free Wake On LAN script

Share this post


Link to post
Share on other sites

I tried with a REG file of the HKLM huge, this file is about 57000 ko. And it doesn't works. Does AutoIt can open a file that has this size ?


Olivier, from France.Free Wake On LAN script

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  
Followers 0