Jump to content
Sign in to follow this  
Vindicator209

0 args error?

Recommended Posts

Vindicator209

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]

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
Vindicator209

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]

Share this post


Link to post
Share on other sites
Richard Robertson

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

Share this post


Link to post
Share on other sites
NELyon

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.

Share this post


Link to post
Share on other sites
trancexx

Perhaps he modified the code before he located the actual error and after he pasted the console output onto this here forum.

I believe that is not what Richard Robertson meant.

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
Richard Robertson

Yes, that's what I was asking. Why output info on a line that doesn't contain an error?

Share this post


Link to post
Share on other sites
Valik

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.

Share this post


Link to post
Share on other sites
Richard Robertson

Ah, single pass does explain it. Thanks.

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  

×