Page 1 of 1
How to find out what is in a default library?
Posted: Thu Apr 09, 2015 6:38 am
by Peter Wood
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)?
Re: How to find out what is in a default library?
Posted: Thu Apr 09, 2015 9:52 am
by livecodeali
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.
Re: How to find out what is in a default library?
Posted: Thu Apr 09, 2015 1:58 pm
by Peter Wood
Many thanks Ali.
I suspect that the issue I faced with min was that I didn't add
to the widget. I didn't think it was needed as the docs referred to it as a "default" library.
Re: How to find out what is in a default library?
Posted: Thu Apr 09, 2015 10:04 pm
by peter-b
Peter Wood wrote:Many thanks Ali.
I suspect that the issue I faced with min was that I didn't add
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.

Re: How to find out what is in a default library?
Posted: Fri Apr 10, 2015 9:16 am
by livecodeali
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.
Re: How to find out what is in a default library?
Posted: Fri Apr 10, 2015 12:03 pm
by Peter Wood
Thanks for the explanation Ali.