Jump to content

Recommended Posts

Posted

I have a function. tested it, works fine

func _inimake()
    $stitle = "title1=" & @LF & "title2=" & @LF & "title3="& @LF & "title4=" & @LF & "title5="& @LF & "title6=" & @LF & "title7="& @LF & "title8=" & @LF & "title9=" _
    & @LF &"title10=" & @LF & "title11="& @LF & "title12=" & @LF & "title13="& @LF & "title14=" & @LF & "title15="
    IniWriteSection($ini, "TITLE", $stitle)
    FileOpen($ini,1)
    FileWrite($ini, @CRLF)
    FileClose($ini)
    $stext = "text1=" & @LF & "text2=" & @LF & "text3="& @LF & "text4=" & @LF & "text5="& @LF & "text6=" & @LF & "text7="& @LF & "text8=" & @LF & "text9=" _
    & @LF &"text10=" & @LF & "text11="& @LF & "text12=" & @LF & "text13="& @LF & "text14=" & @LF & "text15="
    IniWriteSection($ini, "Text", $stext)
    FileOpen($ini,1)
    FileWrite($ini, @CRLF)
    FileClose($ini)
    $shsk = "key1=" & @LF & "key2=" & @LF & "key3="& @LF & "key4=" & @LF & "key5="& @LF & "key6=" & @LF & "key7="& @LF & "key8=" & @LF & "key9=" _
    & @LF &"key10=" & @LF & "key11="& @LF & "key12=" & @LF & "key13="& @LF & "key14=" & @LF & "key15="  
    IniWriteSection($ini, "HotSetKey", $shsk)
EndFunc

When I test the script, it works fine. When I compile it, I get a error: (147,40) : ERROR: IniWriteSection(): undefined function.

IniWriteSection($ini, "TITLE", $stitle)

It only says the first iniwritesection is broke, but the other ones work fine. very odd.

Posted

Don't know the reason IniWriteSection() doesn't work when is compile, but I think this will work better for you. Also I notice you are using $ini inside _inimake() function, be sure $ini is a global variable.

func _inimake()
    For $x = 1 To 15
        IniWrite($ini, 'TITLE', 'title' & $x, '')
        IniWrite($ini, 'Text', 'text' & $x, '')
        IniWrite($ini, 'HotSetKey', 'key' & $x, '')
    Next
EndFunc
AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Posted

The only error I got was because $ini was not defined. Adding just $ini = "Test.ini" to the top made it compile cleanly in 3.2.8.1 Prod, 3.2.9.3 Beta, and 3.2.9.9 Beta. Can't see the symptom.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted (edited)

I had made $ini global in the script to begin with, so I don't think that is it. Also, why would the first one cause it to flip out, and the second one work fine? I wonder if it is a issue with the compiler... :P

Also, the error is saying the function IniWriteSection is undefined. Yet, the second time it is used, it works fine..

;)

Edited by Volly

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...