A compile problem

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
ajperks
Posts: 60
Joined: Sat Sep 06, 2014 3:38 pm

A compile problem

Post by ajperks » Sat Jun 30, 2018 8:33 pm

Years ago I developed a peculiar type of database app in livecode.
It compiles fine in the 7.1 version, there is an issue in 8.1.10 and drops dead in 9.0

I attach the livecode stack in case anyone wants to help me cure the problem, whatever it is.
NB, there is a bug in the text handling with 7.1 that isn't there in earlier versions of livecode. I hope to correct this, provided I can compile it in the latest version of livecode.
Any takers?
Attachments
Contact Manager V9 20-4-2018.zip
(24.23 KiB) Downloaded 14 times

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6236
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: A compile problem

Post by FourthWorld » Sun Jul 01, 2018 2:41 am

I'm on a phone right now, but can you tell us what the error is? Normally the compilation error dialog will take you right to it.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

ajperks
Posts: 60
Joined: Sat Sep 06, 2014 3:38 pm

Re: A compile problem

Post by ajperks » Sun Jul 01, 2018 10:47 pm

Hello Richard, Version 9. The empty files are created and after several progress dialogs, it gets as far as closing stacks and the dialog box disappears. As I said, it dies on the spot. This is in the latest version of LC.
Version 8 LC did finish this time.

Any ideas?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6236
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: A compile problem

Post by FourthWorld » Mon Jul 02, 2018 5:09 am

Ah, thanks. Script compilation errors provide more detail. This build issue just seems like a bug.

What's the target platform?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

ajperks
Posts: 60
Joined: Sat Sep 06, 2014 3:38 pm

Re: A compile problem

Post by ajperks » Mon Jul 02, 2018 8:23 am

The platform is windows.
Thanks for your help so far.

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 507
Joined: Fri Feb 06, 2015 4:03 pm

Re: A compile problem

Post by LiveCode_Panos » Mon Jul 02, 2018 2:55 pm

Hello ajperks,

In LC 9.0, when building a standalone the messages are no longer locked, so the mainstack does receive messages. This is mentioned and explained in detail in the Release Notes, in the "Breaking Changes" section.

Your stack has a handler:

Code: Select all

on closeStack
   quit
end closeStack
So since this message is sent when building a standalone, LiveCode quits, as expected.

To fix this problem, you can modify this handler as follows:

Code: Select all

on closeStack
   if the mode of stack "revStandaloneProgress" > 0 then
      exit closeStack 
   end if
   quit
end closeStack
Best,
Panos
--

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6236
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: A compile problem

Post by FourthWorld » Mon Jul 02, 2018 6:15 pm

Thanks, Panos.

1. Why would not looking messages prevent the SB from succeeding without notice?

2. Is there any internal discussion of moving the SB to a separate process to make all these complications go away?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

ajperks
Posts: 60
Joined: Sat Sep 06, 2014 3:38 pm

Re: A compile problem

Post by ajperks » Tue Jul 03, 2018 9:12 am

Thank you Panos and all for your help and advice. I will have the opportunity in a couple of day's time to try this out.
I am sure this will work.
I certainly would never have found this issue without your help. It makes it worthwhile sorting out the other bugs that have crept in with successive upgraded versions.
If I don't continue this thread, please know I am happy now.

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 507
Joined: Fri Feb 06, 2015 4:03 pm

Re: A compile problem

Post by LiveCode_Panos » Tue Jul 03, 2018 9:45 am

@Richard,

1. The standalone builder has always needed to close the stacks it builds for reasons pretty deeply ingrained in the code. However this causes a few problems, for example:

- values in script locals become empty
- behaviors are broken when the parent script is on / in a stack which closes

As an attempt to improve this situation, the code that locks messages when closing and opening stacks for standalone builds has been removed. This means that where previously mainstacks would not receive openStack and closeStack messages during standalone build, they now do. So if you have a call to "quit" in the closeStack handler, LC will quit. This can be prevented by exiting these handlers if a standalone build is in progress. To check that:

Code: Select all

on closeStack
   if the mode of stack "revStandaloneProgress" > 0 then
      exit closeStack 
   end if
   ...
   ...
end closeStack
2. Yes, that would be ideal. We had discussed refactoring the S/B in the past, but it requires an amount of work, so I don't see it happening in the near future.

@ajperks
You are welcome :)

Best,
Panos
--

jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 285
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

Re: A compile problem

Post by jameshale » Wed Jul 04, 2018 1:11 am

@panos
Just a question.
Why can’t something like ...
on closeStack
if the mode of stack "revStandaloneProgress" > 0 then
exit closeStack
end if
Be built into the standalone builder scripts?

bwmilby
Posts: 216
Joined: Wed Jun 07, 2017 5:37 am
Location: New Orleans, LA
Contact:

Re: A compile problem

Post by bwmilby » Wed Jul 04, 2018 1:32 am

Or even lock messages when closing the stacks and then unlock when re-opening so that the behaviors get established properly...
Brian Milby

Script Tracker https://github.com/bwmilby/lc-misc/tree/master/ScriptTracker

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2259
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: A compile problem

Post by jmburnod » Tue Oct 30, 2018 10:32 am

Hi All,
I get an error on IDE (LC 9.0.1)
can't find stack
so i added some lines to avoid this:

Code: Select all

on closeStack
   if there is a stack "revStandaloneProgress" then
      if the mode of stack "revStandaloneProgress" > 0 then
         exit closeStack
      end if
   else
      pass closeStack
   end if
end closeStack
Best regards
Jean-Marc

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”