Jump to content

"badly formatted function"


gcue
 Share

Recommended Posts

no idea why this is coming up as a badly formatted function.. first time i see this error =/

Func Run()
Local $location, $L, $device, $d
$location = IniReadSectionNames(@UserName & "\devices.ini")
If IsArray($location) Then
    For $L = 1 To $location[0]
        $device = IniReadSection(@UserName & "\devices.ini", $location[$L])
        If IsArray($device) Then
            For $d = 1 To $device[0][0]

Ping($device[$d][1])

    If @error Then
     $status="OFFLINE"
    EndIf

    If Not @error Then
     $status="ONLINE"
    EndIf
 
FileWrite($statusfile, '' &@CRLF & _
                 $location[$L] & "," & $device[$d][0] & "," & $status) 

           Next
        Else
            MsgBox(16, "Error", "There was an error reading section: " & $location[$L] & @CRLF & "Section Number was: " & $L)
        EndIf
    Next
Else
    MsgBox(16, "", "Error occurred, probably no INI file.")
EndIf
EndFunc
Link to comment
Share on other sites

There is already a Run() function built into AutoIt3, friend; AutoIt is telling you that it doesn't like the name you've chosen.

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

got it!

lol

thanks =>

You can usually solve that by adding an underscore

Func _Run()

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

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
 Share

  • Recently Browsing   0 members

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