Error Messages

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3623
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Error Messages

Post by richmond62 » Wed Jul 10, 2019 3:26 pm

NO!

How about something like this:

Left operand contains non-numeric char
.

And that, forbye, leads me onto ask how one determines
whether a char is a number, an alphabetic
something, an operator or something else (sic as a carriage return).

Mun be a wee bit of pseudocode widnae be that bad:

if char XX is an operator then
put "op"
else
put "non-op"
end if

bogs
Posts: 3825
Joined: Sat Feb 25, 2017 10:45 pm

Re: Error Messages

Post by bogs » Wed Jul 10, 2019 4:20 pm

richmond62 wrote:
Wed Jul 10, 2019 3:26 pm
NO!
How about something like this:
Left operand contains non-numeric char.
In the case of what I posted, I was merely showing a more clearly defined error. I've edited the picture to show what I wanted your attention drawn to more clearly.
ErrorClearlyExplained.png
Lines and dots...
In this example, the debugger is telling you that the quotation mark is an illegal character, then goes on to not only mark the line the error is occurring in, but also underlines the offending character with a red squiggly mark.

I am well aware that the debugger in Lc tells you the line number and character number, but counting characters manually probably isn't the best way to go about it. Not only that, but I've often seen it incorrectly identified, such as when the error occurs in an if/then statement.

The error I was seeing with the save with format that I couldn't figure out did correctly identify that I needed a "('" surrounding the number, but was less opaque on exactly what the error was.
Image

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2827
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Error Messages

Post by mwieder » Wed Jul 10, 2019 6:20 pm

That's better, although a one-line function is a trivial example for this.
The IDE's debugger could indeed pinpoint the error: there's a function for this.

dispatch "goLine" && tLineNumber, "position", tPosition
# tLineNumber = line number in script
# tPosition = startChar,endChar

PowerDebug already does this. But to Richmond's point...

Having "pow" in the error message instead of "power" or better yet "exponent" is worthy of a bug report IMO. And it's a simple change to a header file if you want to file a pull request.

bogs
Posts: 3825
Joined: Sat Feb 25, 2017 10:45 pm

Re: Error Messages

Post by bogs » Wed Jul 10, 2019 7:32 pm

mwieder wrote:
Wed Jul 10, 2019 6:20 pm
That's better, although a one-line function is a trivial example for this.
Agreed, but it was the best I could come up with off the top of my head for illustration purposes :D

It is probably a sad example of how much time I am spending in Lc these days, I could not remember how to put the function I was going to use together off the top of my head :(
Image

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2827
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Error Messages

Post by mwieder » Wed Jul 10, 2019 7:46 pm

ikr

I was trying to remember some ruby syntax the other day, something that should have just rolled off my fingertips, and actually had to go look it up.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3623
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Error Messages

Post by richmond62 » Wed Jul 10, 2019 7:50 pm

OK, OK; let's get "down and dirty" about 'power' and 'exponent' . . .

This could also be retitled "Richmond's School days revisited" . . . which is, frankly, a mixed blessing.

Bonehead Barker, my guru, spiritual preceptor and Maths teacher (and please note here, he
was a Maths teacher, and NOT a Math teacher), told us chelas that:

X^2 was "X squared"

X^3 was "X cubed"

and X^4 was "X to the 4" . . .

or, at worst, "X to the power 4" . . .

and when anyone says 'exponent' I think 'exponential' and logarithmic curves, and, frankly,
have an attack of the Heebie-Jeebies.

We could also explore the reason why I have, in my bookshelves in Bulgaria,
a facsimile of Noah Webster's original 'English' dictionary . . .

Now, while LiveCode is headquartered in Scotland, they have always pandered to our Free cousins
across the pond (we Scots, never having freed ourselves, cough, cough) in their insistent use of
North American English throughout LiveCode.

The problem is NOT a fight between cousin Weider and myself, I mean, hey, we almost cuddled
each other in Edinburgh 9-10 years ago, but it is between which English to use in error messages . . .

Jamaican Creole, anyone?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3623
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Error Messages

Post by richmond62 » Wed Jul 10, 2019 7:54 pm

I was trying to remember some ruby syntax the other day
Well, I was trying to remember to words to songs from "Jonah Man Jazz" by Michael Hurd. :D

https://sonichits.com/video/Michael_Hur ... to_the_sea

Grooooooooovy 1970s, Austin Powersy sort of stuff, but not much use with Livecode.
Last edited by richmond62 on Wed Jul 10, 2019 10:00 pm, edited 1 time in total.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2827
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Error Messages

Post by mwieder » Wed Jul 10, 2019 8:05 pm

Heh. I was (re)watching Stop Making Sense last night and trying to remember the name of the song "Once In A Lifetime" even though it was repeated in the lyrics and then I'd get it and get wrapped up in the movie and forget again... but I digress (no surprise)

I don't really care what the wording is, but I think everyone can agree (famous last words) that "pow" is inadequate.

More to the point, though, I think, is that the error message given, while technically correct, is not all that useful in determining where the actual problem lies.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3623
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Error Messages

Post by richmond62 » Wed Jul 10, 2019 9:59 pm

technically correct
My father (who died last year) had a joke that was also "technically correct":

A Scots journalist went out to Oklahoma to interview a Red Indian (whoops, Native American) chief
who was famed for having a good memory.

He waited and waited for the chief in the hotel, and while he waited he had a dish of fried eggs.

Eventually the chief turned up, sat down, and said nothing, and, after a while,
the journalist, believing he was wasting his time, left.

40 years later the same journalist found himself in the same hotel, and seeing the chief sitting
in the corner, and thinking he was being witty, went up to him and said, "How!"

To which the chief replied, "Fried!"

Post Reply

Return to “Feature Requests”