How to find out what is in a default library?

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
Peter Wood
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 92
Joined: Mon Jul 06, 2009 4:53 am
Location: Bamboo River

How to find out what is in a default library?

Post by Peter Wood » Thu Apr 09, 2015 6:38 am

I tried to use the min function in LiveCodeBuilder thinking that it could be in the default com.livecode.math library. It wasn't, well not in the form that I tried to use - min(Real, Real). So I tried unsuccessfully to find the code of the library in GitHub. Is there any easy way to find out the API of the defaults libraries (or any library for that matter)?

livecodeali
Livecode Staff Member
Livecode Staff Member
Posts: 192
Joined: Thu Apr 18, 2013 2:48 pm

Re: How to find out what is in a default library?

Post by livecodeali » Thu Apr 09, 2015 9:52 am

Hi Peter,

The syntax binding for min is here:

https://github.com/runrev/livecode/blob ... h.mlc#L478

I'm not sure why it isn't working for you though - it looks like you were using it in the right way.

All of the LCB API is supposed to be documented in the LiveCode Builder dropdown of the API tab of the dictionary, although I see that the math function-style syntax doesn't seem to be in there.

Peter Wood
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 92
Joined: Mon Jul 06, 2009 4:53 am
Location: Bamboo River

Re: How to find out what is in a default library?

Post by Peter Wood » Thu Apr 09, 2015 1:58 pm

Many thanks Ali.

I suspect that the issue I faced with min was that I didn't add

Code: Select all

use com.livecode.math
to the widget. I didn't think it was needed as the docs referred to it as a "default" library.

peter-b
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm
Location: LiveCode Ltd.

Re: How to find out what is in a default library?

Post by peter-b » Thu Apr 09, 2015 10:04 pm

Peter Wood wrote:Many thanks Ali.

I suspect that the issue I faced with min was that I didn't add

Code: Select all

use com.livecode.math
to the widget. I didn't think it was needed as the docs referred to it as a "default" library.
It's a "default library" in the sense that it's always available to use without having to install any extra extensions from the store. :)
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com

livecodeali
Livecode Staff Member
Livecode Staff Member
Posts: 192
Joined: Thu Apr 18, 2013 2:48 pm

Re: How to find out what is in a default library?

Post by livecodeali » Fri Apr 10, 2015 9:16 am

All the syntax in the 'default' libraries is available without an explicit use statement - the reason you have to use com.livecode.math in this case is that the min handler is a public handler rather than syntax.

Peter Wood
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 92
Joined: Mon Jul 06, 2009 4:53 am
Location: Bamboo River

Re: How to find out what is in a default library?

Post by Peter Wood » Fri Apr 10, 2015 12:03 pm

Thanks for the explanation Ali.

Post Reply

Return to “LiveCode Builder”