compiler not catching bad exit within routine

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

compiler not catching bad exit within routine

Dr. Hawkins
I have a (much longer) routine to the nature of

on mkNwDnaRec


if something then

exit makeNewDnaRec

end if

end mkNwDnaRec



The compiler doesn't choke when saving the editor window.

It does, though, file to go to mkNwDnaRec stating that it can't find it.

I then paste the routine into another script, and it catches the error.

Paste it back, and it still isn't caught.

???
--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: compiler not catching bad exit within routine

Ali Lloyd-2
I've no idea what the problem could be, but when things like this happen to
me I copy the routine and continually delete lines until either I discover
what I did wrong, or have a very minimal test case.

On Tue, Dec 6, 2016 at 9:30 PM Dr. Hawkins <[hidden email]> wrote:

> I have a (much longer) routine to the nature of
>
> on mkNwDnaRec
>
>
> if something then
>
> exit makeNewDnaRec
>
> end if
>
> end mkNwDnaRec
>
>
>
> The compiler doesn't choke when saving the editor window.
>
> It does, though, file to go to mkNwDnaRec stating that it can't find it.
>
> I then paste the routine into another script, and it catches the error.
>
> Paste it back, and it still isn't caught.
>
> ???
> --
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: compiler not catching bad exit within routine

Dave Kilroy
In reply to this post by Dr. Hawkins
You define a handler "mkNwDnaRec" but your exit statement refers to "makeNewDnaRec" ...
"The first 90% of the task takes 90% of the time, and the last 10% takes the other 90% of the time."
Peter M. Brigham
Reply | Threaded
Open this post in threaded view
|

Re: compiler not catching bad exit within routine

Dr. Hawkins
On Tue, Dec 6, 2016 at 2:52 PM, Dave Kilroy <[hidden email]>
wrote:

> You define a handler "mkNwDnaRec" but your exit statement refers to
> "makeNewDnaRec" ...
>
>
Correct.

That should throw any error on script save--but it doesn't.

The rest of the script compiles, but this routine quietly doesn't.




--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: compiler not catching bad exit within routine

Dr. Hawkins
In reply to this post by Ali Lloyd-2
On Tue, Dec 6, 2016 at 3:03 PM, Ali Lloyd <[hidden email]> wrote:

> I've no idea what the problem could be, but when things like this happen to
> me I copy the routine and continually delete lines until either I discover
> what I did wrong, or have a very minimal test case.
>


That's my usual approach, but it failed here.

And cut & paste into another stack worked.

I then came up with a completely new name, and copied a few lines at a time
into the new handler, and it worked.

Something's rotten . . .


--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: compiler not catching bad exit within routine

mwieder
In reply to this post by Dr. Hawkins
Yeah, I think that's the point of the original post.

My guess is that there's a "makeNewDnaRec" variable somewhere in the original script.
--
 Mark Wieder
 ahsoftware@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: compiler not catching bad exit within routine

Dr. Hawkins
On Tue, Dec 6, 2016 at 4:01 PM, mwieder <[hidden email]> wrote:

> My guess is that there's a "makeNewDnaRec" variable somewhere in the
> original script.
>

just checked; and no.

And strict compilation is on (although it seems to keep getting turned off).


--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: compiler not catching bad exit within routine

Dave Kilroy
In reply to this post by Dr. Hawkins
Ah right I get it now

Have you tried checking your script for invisible characters? Try copying the entire script to something like BBedit, selecting and copying it afresh there, deleting everything in the LiveCode script, saving it to ensure it's clean, pasting in the (hopefully cleaned) script from Bbedit and finally saving...
"The first 90% of the task takes 90% of the time, and the last 10% takes the other 90% of the time."
Peter M. Brigham
Reply | Threaded
Open this post in threaded view
|

Re: compiler not catching bad exit within routine

Ali Lloyd-2
Or try this if the script is not supposed to have any non-ascii characters:

local tLineCount, tCPCount
repeat for each line tLine in <script>
add 1 to tLineCount
put 0 into tCPCount
repeat for each codepoint tCP in tLine
   add 1 to tCPCount
   get codepointToNum(tCP)
   if it > 127 then
      answer "codepoint" && it && "at" && tCPCount && "in line" &&
tLineCount
  end if
end repeat
end repeat


On Wed, Dec 7, 2016 at 11:21 AM Dave Kilroy <[hidden email]>
wrote:

> Ah right I get it now
>
> Have you tried checking your script for invisible characters? Try copying
> the entire script to something like BBedit, selecting and copying it afresh
> there, deleting everything in the LiveCode script, saving it to ensure it's
> clean, pasting in the (hopefully cleaned) script from Bbedit and finally
> saving...
>
>
>
> -----
> "The first 90% of the task takes 90% of the time, and the last 10% takes
> the other 90% of the time."
> Peter M. Brigham
> --
> View this message in context:
> http://runtime-revolution.278305.n4.nabble.com/compiler-not-catching-bad-exit-within-routine-tp4710898p4710907.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: compiler not catching bad exit within routine

Dr. Hawkins
In reply to this post by Dave Kilroy
On Wed, Dec 7, 2016 at 3:21 AM, Dave Kilroy <[hidden email]>
wrote:

> Have you tried checking your script for invisible characters? Try copying
> the entire script to something like BBedit, selecting and copying it afresh
> there, deleting everything in the LiveCode script, saving it to ensure it's
> clean, pasting in the (hopefully cleaned) script from Bbedit and finally
> saving...
>

I didn't even have to go that far.

Pasting it into another script whole was enough for that; it gets found
there, and actually compiles & runs.

And to get it going, I added a new handler above it, and pasted a third of
it at a time, including spacing.

But that's the small stuff.

The real problem here is that the compiler is quietly failing.  the rest of
the script gets compiled, no error is thrown, and the problem can't be
found until another routine attempts to call this routine and it can't be
found.


There *should* be an error whenever the compile fails to compile . . .

FWIW, this was the las hanger in that script, so I don't know what would
have happened to subsequent handlers.


--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

RE: compiler not catching bad exit within routine

Ralph DiMola
I just had a problem like this minutes ago. I had fat fingers and must have
hit some bizarre ctrl key combo and LC(8.1.1) instantly quit with no
messages. I restarted LC When I opened the script LC was OK but when I
clicked the left bar to select the handler I was working on... BOOM LC quit
again. I restarted LC again, opened the script and selected the entire
script (15,000 lines) and copied it to the clipboard, then deleted the
entire script, I clicked Apply and then pasted the 15,00 lines back in,
clicked Apply again. I was now able to click on the handler I was working on
and go on my merry way(but not before I did a "ctrl S").

Ralph DiMola
IT Director
Evergreen Information Services
[hidden email]

-----Original Message-----
From: use-livecode [mailto:[hidden email]] On Behalf
Of Dr. Hawkins
Sent: Wednesday, December 07, 2016 11:13 AM
To: How to use LiveCode
Subject: Re: compiler not catching bad exit within routine

On Wed, Dec 7, 2016 at 3:21 AM, Dave Kilroy <[hidden email]>
wrote:

> Have you tried checking your script for invisible characters? Try
> copying the entire script to something like BBedit, selecting and
> copying it afresh there, deleting everything in the LiveCode script,
> saving it to ensure it's clean, pasting in the (hopefully cleaned)
> script from Bbedit and finally saving...
>

I didn't even have to go that far.

Pasting it into another script whole was enough for that; it gets found
there, and actually compiles & runs.

And to get it going, I added a new handler above it, and pasted a third of
it at a time, including spacing.

But that's the small stuff.

The real problem here is that the compiler is quietly failing.  the rest of
the script gets compiled, no error is thrown, and the problem can't be found
until another routine attempts to call this routine and it can't be found.


There *should* be an error whenever the compile fails to compile . . .

FWIW, this was the las hanger in that script, so I don't know what would
have happened to subsequent handlers.


--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: compiler not catching bad exit within routine

Bob Sneidar-2
In reply to this post by Dr. Hawkins
Another thing to try that helped me more than once is to copy/paste the script (the ENTIRE script not just the handlers) into a text file formatted for Text Only then copy/paste it back into your script replacing what is there. I think it has something to do with the unicode text thingummy.

Bob S


On Dec 6, 2016, at 16:12 , Dr. Hawkins <[hidden email]<mailto:[hidden email]>> wrote:

On Tue, Dec 6, 2016 at 2:52 PM, Dave Kilroy <[hidden email]<mailto:[hidden email]>>
wrote:

You define a handler "mkNwDnaRec" but your exit statement refers to
"makeNewDnaRec" ...


Correct.

That should throw any error on script save--but it doesn't.

The rest of the script compiles, but this routine quietly doesn't.




--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode