Page 2 of 2

Re: Error Messages

Posted: Wed Jul 10, 2019 3:26 pm
by richmond62
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

Re: Error Messages

Posted: Wed Jul 10, 2019 4:20 pm
by bogs
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.

Re: Error Messages

Posted: Wed Jul 10, 2019 6:20 pm
by mwieder
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.

Re: Error Messages

Posted: Wed Jul 10, 2019 7:32 pm
by bogs
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 :(

Re: Error Messages

Posted: Wed Jul 10, 2019 7:46 pm
by mwieder
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.

Re: Error Messages

Posted: Wed Jul 10, 2019 7:50 pm
by richmond62
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?

Re: Error Messages

Posted: Wed Jul 10, 2019 7:54 pm
by richmond62
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.

Re: Error Messages

Posted: Wed Jul 10, 2019 8:05 pm
by mwieder
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.

Re: Error Messages

Posted: Wed Jul 10, 2019 9:59 pm
by richmond62
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!"