Jump to content

Func Error message in Scite


Recommended Posts

I keep getting these errors saying there is no matching EndFunc and this script used to work fine before upgrading to latest version of AutoIT and Scite. Is there anytype of bug? The version is still 3 but just updated to the latest including scite and now it has problems.

C:\Documents and Settings\twhite\My Documents\AutoIt\arprem\arprem2.0.au3(885,1) : ERROR: syntax error

Func

^

this is the code starting on that line. Everything else is commented out after this function when I was testing it.

Func ARPUsagelog($ARPTitle)
If Not FileExists($Config4) Then
_FileCreate($Config4)
EndIf
$log = FileOpen($Config4, 1)
; Check if file opened for writing OK
If $log = -1 Then
MsgBox(0, $AppTitle, "Unable to open log.")
EndIf
$officelocation = GUICtrlRead($Location)
FileWrite($log, @CRLF & $ARPTitle & " was ran on -" & @ComputerName & "- in " & $officelocation & " on " & @MON & "/" & @MDAY & "/" & @YEAR & " at " & @HOUR & ":" & @MIN & " by " & @UserName)
FileClose($log) 
EndFunc
EndFuncAutoIt is the shiznit. I love it.
Link to comment
Share on other sites

I keep getting these errors saying there is no matching EndFunc and this script used to work fine before upgrading to latest version of AutoIT and Scite. Is there anytype of bug? The version is still 3 but just updated to the latest including scite and now it has problems.

C:\Documents and Settings\twhite\My Documents\AutoIt\arprem\arprem2.0.au3(885,1) : ERROR: syntax error

Func

^

this is the code starting on that line. Everything else is commented out after this function when I was testing it.

Func ARPUsagelog($ARPTitle)
If Not FileExists($Config4) Then
_FileCreate($Config4)
EndIf
$log = FileOpen($Config4, 1)
; Check if file opened for writing OK
If $log = -1 Then
MsgBox(0, $AppTitle, "Unable to open log.")
EndIf
$officelocation = GUICtrlRead($Location)
FileWrite($log, @CRLF & $ARPTitle & " was ran on -" & @ComputerName & "- in " & $officelocation & " on " & @MON & "/" & @MDAY & "/" & @YEAR & " at " & @HOUR & ":" & @MIN & " by " & @UserName)
FileClose($log) 
EndFunc
Run Tidy (Ctrl + T) and the Syntax Check (Ctrl +F5) and see if there are any other issues tagged. I'll occasionally get a false hit like this and it'll turn out to be something else causing a chain of errors - EX: an If statement earlier in the code is missing an EndIf or some such issue.

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Link to comment
Share on other sites

Hi,

I tested this. No problem there:

#include<File.au3>
Global $Config4, $AppTitle, $Location
Func ARPUsagelog($ARPTitle)
    If Not FileExists($Config4) Then
        _FileCreate($Config4)
    EndIf
    $log = FileOpen($Config4, 1)
   ; Check if file opened for writing OK
    If $log = -1 Then
        MsgBox(0, $AppTitle, "Unable to open log.")
    EndIf
    $officelocation = GUICtrlRead($Location)
    FileWrite($log, @CRLF & $ARPTitle & " was ran on -" & _
    @ComputerName & "- in " & $officelocation & " on " & _
    @MON & "/" & @MDAY & "/" & @YEAR & " at " & @HOUR & ":" & @MIN & " by " & @UserName)
    FileClose($log)
EndFunc  ;==>ARPUsagelog

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Yeah its weird. I to have gotten false reading before because of something else messing it up but can't find anything else wrong.

This tidy errors aren't making sense. These functions have worked fine before and I don't even understanding what this error is. I don' t have any func inside a condition or loop. I have them inside Functions like the code I posted above.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(779) : ### Tidy Error -> "func" Not closed before "Func" statement.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(779) : ### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(839) : ### Tidy Error -> "func" Not closed before "Func" statement.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(839) : ### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(851) : ### Tidy Error -> "func" Not closed before "Func" statement.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(851) : ### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(872) : ### Tidy Error -> "func" Not closed before "Func" statement.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(872) : ### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(883) : ### Tidy Error -> "func" Not closed before "Func" statement.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(883) : ### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(898) : ### Tidy Error -> "func" Not closed before "Func" statement.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(898) : ### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(915) : ### Tidy Error -> "func" Not closed before "Func" statement.

c:\documents and settings\twhite\my documents\autoit\arprem\arprem2.0.au3(915) : ### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement.

!> there were 14 error(s) encountered. look in your source for:### Tidy Error:

Also this is syntax check. Never had a problem before.

C:\Documents and Settings\twhite\My Documents\AutoIt\arprem\arprem2.0.au3(779,2) : ERROR: syntax error

Func

^

C:\Documents and Settings\twhite\My Documents\AutoIt\arprem\arprem2.0.au3(329,37) : ERROR: ARPUsagelog(): undefined function.

ARPUsagelog($ConsoleTitle[$i])

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\twhite\My Documents\AutoIt\arprem\arprem2.0.au3(335,16) : ERROR: Savetolog(): undefined function.

Savetolog()

~~~~~~~~~~^

C:\Documents and Settings\twhite\My Documents\AutoIt\arprem\arprem2.0.au3(418,24) : ERROR: AdminConsole(): undefined function.

Call("AdminConsole")

~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\twhite\My Documents\AutoIt\arprem\arprem2.0.au3(455,17) : ERROR: ShowProgPath(): undefined function.

ShowProgPath()

~~~~~~~~~~~~~^

Edited by EndFunc
EndFuncAutoIt is the shiznit. I love it.
Link to comment
Share on other sites

Wow, I found the problem. I misplaced #cs. Sorry guys, but I really appreciate the help. Now I feel dumb. Too much code to look through. :)

Edited by EndFunc
EndFuncAutoIt is the shiznit. I love it.
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...