Jump to content

0 args error?


Recommended Posts

SCiTE returns

F:\My Documents\SRChatbot\SRChat\SRChat.au3(479,25) : ERROR: ChangeSize() called by a previous line with 0 arg(s). Min = 1. First previous line calling this Func is 260.
Func ChangeSize($s_size)

Even when my line # 260 is:

ChangeSize(8)

I tried putting 8 in quotes too but I get the same error...

I just ignored the error, and it works fine, but the error right before testing is kind of annoying...

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

SCiTE returns

F:\My Documents\SRChatbot\SRChat\SRChat.au3(479,25) : ERROR: ChangeSize() called by a previous line with 0 arg(s). Min = 1. First previous line calling this Func is 260.
Func ChangeSize($s_size)

Even when my line # 260 is:

ChangeSize(8)

I tried putting 8 in quotes too but I get the same error...

I just ignored the error, and it works fine, but the error right before testing is kind of annoying...

Note the text: "First previous line calling this Func is 260." That doesn't mean that is where the error came from.

Check every line where ChangeSize() is called, not just line 260. Somewhere you are calling it with no parameter.

:mellow:

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
Link to comment
Share on other sites

uhh...yep that dunnit... the error was on 309...I didn't notice it... thanks!

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

Why doesn't the error output contain the actual line that the error occurred on?

Perhaps he modified the code before he located the actual error and after he pasted the console output onto this here forum.
Link to comment
Share on other sites

The syntax checker always reports the first time the function is called (before the function declaration) and reports that by default. Consider the following demo:

$iDelta = _Delta(1, -2)
ConsoleWrite("Delta(2,-3) = " & $iDelta & @LF)

$iDelta = _Delta()
ConsoleWrite("Delta(2,-3) = " & $iDelta & @LF)

$iDelta = _Delta(3, -4)
ConsoleWrite("Delta(2,-3) = " & $iDelta & @LF)

Func _Delta($iX, $iY)
    Return Abs($iX - $iY)
EndFunc

Output of AU3Check error:

C:\temp\Test\Test1.au3(10,22) : ERROR: _Delta() called by a previous line with 0 arg(s). Min = 2. First previous line calling this Func is 1.
Func _Delta($iX, $iY)
~~~~~~~~~~~~~~~~~~~~~^
C:\temp\Test\Test1.au3 - 1 error(s), 0 warning(s)

The error, of course, is in the second call at line 4.

Since this is pre-proccessing, it does seem like it should be able to tell you where it found the error.

Jos?

:mellow:

Edited by PsaltyDS
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
Link to comment
Share on other sites

Au3Check makes one pass of the document. At the time it sees the function being called it doesn't actually know anything about it so it guesses. Later when it does find out the real details, it see's that it's guess was wrong but it doesn't really know what line it was wrong on. This is a design limitation and there are numerous places where this single-pass design of Au3Check leads to incorrect errors. In this case it does correctly flag an error it just doesn't tell you where it is. In other cases it flags an error when there isn't one.

There isn't much that can be done about it unless Au3Check is re-written.

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