Confused by "Libraries" and "inclusions"

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Confused by "Libraries" and "inclusions"

Post by Simon Knight » Mon May 06, 2019 8:57 am

Hi,
I have recently lost a few hours debugging a standalone that failed while the IDE version worked. The culprit was the "blur" command which the dictionary lists as a Library and describes as:
blur is a simple external for blurring the imageData and alphaData of an image.
The problem I encountered was caused by building my standalone with the "search for inclusions" option selected.
Screen Shot 2019-05-06 at 07.59.46.png
To create a successful application I have to make a manual selection : and then select the blur library from a long list of options :
Screen Shot 2019-05-06 at 08.00.40.png
What confuses me is that some items are already ticked. This implies that Livecode will automatically include some "external libraries" while missing others.

To recap, it is possible to write and debug an application in the IDE that fails without any error messages when built as a standalone. Why is this? What I mean is why does the IDE allow such a build to be created? Is it unreasonable to expect the IDE to alert the user that a command that is listed in the dictionary needs a slightly obscure box ticking before a build is made? Or that the automatic search for inclusions actually works with all commands listed in the dictionary. I also think that the dictionary entries would be more helpful if they included a line such as "caution - ensure that library Blah is selected before building standalone".

So what are your opinions? Am I a lone fool who should have known better or has this design feature ever caught you out?

best wishes
Simon K.
best wishes
Skids

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

Re: Confused by "Libraries" and "inclusions"

Post by bogs » Mon May 06, 2019 11:49 am

Simon Knight wrote:
Mon May 06, 2019 8:57 am
So what are your opinions? Am I a lone fool who should have known better or has this design feature ever caught you out?
If I had to guess, I would say that this particular thing has caught almost anyone that does more than basic stuff with Lc. Some advise to always choose the include items manually. I've heard that 1.) it speeds the standalone build process, and 2.) your less likely to miss anything :D

The eplanation (as I understand it, which could be WAY off) is that the IDE goes through your various stacks looking for words that will trigger what to include. For me, and the relatively simple things I do, this works out fine. For people whose projects are large, sophisticated, or use more than the basics, I guess it doesn't :wink:

In either case, your not alone in having had this happen. Even though it hasn't ever bitten me personally, I would suspect that it should work in a way less likely to fail. For instance, for it to work in the IDE I am guessing the IDE *has* to know what is in use currently. That list of items should be reserved for the standalone builds, but I guess it is not, or isn't complete.

The only reason I can think of for that is that the IDE isn't able to separate it's needs from your projects needs.
Image

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9645
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Confused by "Libraries" and "inclusions"

Post by dunbarx » Mon May 06, 2019 1:14 pm

What Bogs said. It was Jacque who recommended doing this pretty much all the time. It solved a problem of mine.

I now always include manually. Never looked back.

Craig

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Confused by "Libraries" and "inclusions"

Post by Simon Knight » Mon May 06, 2019 1:18 pm

Thanks both, however, the obvious question is how do you know what to include?
best wishes
Skids

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9645
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Confused by "Libraries" and "inclusions"

Post by dunbarx » Mon May 06, 2019 2:52 pm

That is a good question. You can always include everything. :wink:

The dictionary is very clear, warning that certain commands and functions require concomitant library inclusions. Of course, it is as daunting and ungainly to refer each line of code to a possible dictionary caveat as it is to simply include everything.

But the gadget that does its best to find required inclusions should not be faulted overmuch for missing some. It is a only convenience at best. I guess the author needs to know, and to record, all the libraries that are required.

My own work requires little of these esoteric external files, mainly some printing stuff, so I am lucky that way.

Craig

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Confused by "Libraries" and "inclusions"

Post by Simon Knight » Mon May 06, 2019 4:55 pm

The dictionary is very clear, warning that certain commands and functions require concomitant library inclusions.
I don't think I agree with your statement. The dictionary I see lists "blur" as a library and a command but neither entry mention that an inclusion has to be made. e.g.
Screen Shot 2019-05-06 at 16.48.40.png
(The summary and the description are the same), and
Screen Shot 2019-05-06 at 16.52.20.png
This is why I mentioned in my first post that some form of warning should be included in the dictionary. Do you see more information in your copy of the dictionary ?

best wishes

Simon
best wishes
Skids

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Confused by "Libraries" and "inclusions"

Post by jacque » Mon May 06, 2019 4:58 pm

I do always include extensions manually, partly because the auto-scan sometimes misses things, but also because it cuts build time considerably, especially in anything larger than a single small stack.

I think the scanner doesn't read any stacks that aren't open, so if your build has any entries in the Stacks pane of the standalone builder then I don't think they're scanned. Also, newer commands, like blur, may not have made it into the scanner list yet, so that would be a reportable bug.

The way I decide what to include manually is to just read down the list and if my stack uses that feature I checkmark it. You'd know if your stack uses a widget or a database or the internet, etc.

We're getting so many extensions now, what we really need is a search field to find the thing we want when we know what we're looking for.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Confused by "Libraries" and "inclusions"

Post by jacque » Mon May 06, 2019 5:11 pm

Simon Knight wrote:
Mon May 06, 2019 4:55 pm
The dictionary I see lists "blur" as a library and a command but neither entry mention that an inclusion has to be made.
True, though the terms "library" and "external" are tip-offs. That's not as clear as it might be though.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Confused by "Libraries" and "inclusions"

Post by Simon Knight » Tue May 07, 2019 9:09 am

Hi,

Part of my problem is that the dictionary is inconsistent. I picked a random library and found the following text
Important: The revCacheGeometry command is part of the Geometry library. To ensure that the command works in a standalone application, you must include this custom library when you create your standalone. In the Inclusions pane of the Standalone Application Settings window, make sure the "Geometry" library checkbox is checked.
This should be included on all entries that it applies to.
We're getting so many extensions now, what we really need is a search field to find the thing we want when we know what we're looking for.
I agree. I would also like some better documentation e.g. what do the small icons mean and what is the significance of each type of inclusion? I could not find any details in the PDF documentation. Also a method of listing every command included in an inclusion would be helpful.

I suppose its time for me to learn how to make a submission to the dictionary....

best wishes

Simon K.
best wishes
Skids

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Confused by "Libraries" and "inclusions"

Post by jacque » Tue May 07, 2019 4:53 pm

what do the small icons mean and what is the significance of each type of inclusion?
The icons at the left represent the type of inclusion and as far as I can see they are informational only. The differences don't really matter as far as building an app, though since the list is sorted by type, they can make it easier to find the category you're looking for when scrolling through the list.

The icons at the right tell you which platforms each extension is compatible with.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Confused by "Libraries" and "inclusions"

Post by Simon Knight » Tue May 07, 2019 4:57 pm

Thanks.

I submitted a bug report about the auto system not finding the blur command , but I will heed your point about the build speed being faster if inclusions are specified manually.
best wishes
Skids

Post Reply

Return to “Talking LiveCode”