It_took_my_meds
(Hey THIS is FUN)
2007-12-18 11:35 PM
Invalid UDF call line error bug

Dear Ruud et. al.,

I've found a line error bug relating to invalid UDF calls. Please check out the following code:
 Code:
? "Line 1"
? "Line 2"
Test

Function Test($x)

	$Test=$x
	
EndFunction

Which returns:
 Code:
Line 1
Line 2
ERROR : invalid method/function call: missing '('!
Script: C:\Temp\test.kix
Line  : 10

There are only 9 lines of code in the above script. I assume that KiX is scanning the entire script for a function with the same name and signature. When it gets to the end, it returns the number of lines of the script + 1 as the error line rather than where the error occured.

Regards,

Richard


Witto
(MM club member)
2007-12-19 11:13 PM
Re: Invalid UDF call line error bug

Is this an error? V4.53, 4.52, 4.50 give the same messages.

It_took_my_meds
(Hey THIS is FUN)
2007-12-19 11:22 PM
Re: Invalid UDF call line error bug

Just because older versions also exhibit the same behaviour doesn't preclude it from being an error. It just means that no one has found and reported it before.

Les
(KiX Master)
2007-12-20 02:07 AM
Re: Invalid UDF call line error bug

Are you the QA dept looking for obscure minor things to complain about?

It_took_my_meds
(Hey THIS is FUN)
2007-12-20 02:11 AM
Re: Invalid UDF call line error bug

Hardly. I don't think reporting a bug is complaining at all. I don't care too much if this gets fixed, however I certainly hate any bugs in my code and as a courtesy to Ruud, I'm letting him know about. It is up to him if he wants to do something about it.

Björn
(Korg Regular)
2007-12-21 02:30 PM
Re: Invalid UDF call line error bug

Les - A bug doesn't really have a size - and if it has - it's small, right?
If it's big you usually call it beta or release candidate, no? \:\)

Meds - Agree, it catches the missing (), but throws you of at line that is a bug in my opinion.


LonkeroAdministrator
(KiX Master Guru)
2007-12-21 10:02 PM
Re: Invalid UDF call line error bug

hmm...
this has actually been reported earlier and ruud even answered something but yeah, it never got fixed.

the error messages have had issues as far as I can remember. The issues have changed a lot during the years, but they have never been totally accurate.

also, one might consider the depth of the information of the error being way too shallow.
say, someone writes a line with some 20 function calls from which half of them are nested. How he may know from the error where the problem lies?


Björn
(Korg Regular)
2007-12-22 02:36 AM
Re: Invalid UDF call line error bug

How about doing it the same way a regular error shows - say, if you set the option that you have to declare variables - it halts on the first error period ? Using the same logic here seems to me to be the easiest way, or? Perhaps that doesn't touch that kind of nested code?

Les
(KiX Master)
2007-12-22 03:47 AM
Re: Invalid UDF call line error bug

 Originally Posted By: Björn
Les - A bug doesn't really have a size - and if it has - it's small, right?
Actually, I would not call it a bug. IMHO a bug causes good code to go bad. A properly written script would never manifest this issue. IMHO, it is a feature and as Jooel mentioned, Ruud knows about it but is probably not bothered enough by it to expend the effort to change it.

I tend to get a little defensive when people start crying "BUG" for every little "feature".


Björn
(Korg Regular)
2007-12-22 04:29 AM
Re: Invalid UDF call line error bug

 Originally Posted By: Les
Actually, I would not call it a bug. IMHO a bug causes good code to go bad. A properly written script would never manifest this issue.

Well - The code for getting the proper line goes bad in my opinion. Feature is what I would call it if it was left there with intent - perhaps it was.

Yes, I get you Les - no worries, you know I'll ask if I don't \:\)


It_took_my_meds
(Hey THIS is FUN)
2007-12-23 07:00 AM
Re: Invalid UDF call line error bug

Your confusing issues here. It is a bug in the KiXtart run-time, it just takes a script bug to show it. It is of course a minor bug, and if I was Ruud, I wouldn't necessarily bother to fix it if it wasn't easy to do so.

I would much rather he used his precious time to add things like: .NET support; COM events; multi-threading; references; nested error handling; inbuilt associative arrays; etc...


LonkeroAdministrator
(KiX Master Guru)
2007-12-24 02:30 AM
Re: Invalid UDF call line error bug

nice list of feats dude. maybe not in the perfect order.
but threads, com events and refs would be way cool.

anyhow... this minor thing is a annoying one and it increases the learning curve of a fresh scripter and that's bad.
Giving misleading information where the actual error is can sometimes be really exhausting.