How to get started with ... everything?

Moderators: LCMark, LCfraser

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

Re: How to get started with ... everything?

Post by livecodeali » Wed Jan 17, 2018 4:46 pm

@jameshale
For example if we were calling a Mac binary, what code folder would be required?
In terms of what folder to put code in, this release note should be somewhat helpful:
https://github.com/montegoulding/liveco ... support.md

(and the platform ID document it leads to).

For Mac dylibs, you'd want them in /code/universal-mac/
When calling parts of the Mac or iOS framework we do not actually need a code folder I guess.
Correct
When calling any binary how do we signal to lc that this or that code binary is required.
You should only need to put the binary in the right place and load the extension using the extension builder - everything else is handled by the IDE.

SparkOut
Posts: 1743
Joined: Sun Sep 23, 2007 4:58 pm

Re: How to get started with ... everything?

Post by SparkOut » Wed Jan 17, 2018 10:14 pm

@livecodeali
Thanks, that was a "duh" by me with the ampersand, but correcting that doesn't fix the function. In fact, now it completely crashes out LC.
I have added the foreign data type declaration above the foreign handler binding declaration

Code: Select all

private foreign type CIntArray2 binds to "MCAggregateTypeInfo:EE"
As there are only two analog channels and I can read back the state of each one at a time, I can probably leave it out of the conversion, but I am wondering what the correct syntax for such a structure should be, and why as it is, does Livecode force close (just completely bombs out).

Again, I am learning a lot and really appreciate the help.

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

Re: How to get started with ... everything?

Post by jameshale » Wed Jan 17, 2018 11:44 pm

Thanks @livecodeali

Some of these release notes really need to be migrated into the guides.
More on the todo list.

SparkOut
Posts: 1743
Joined: Sun Sep 23, 2007 4:58 pm

Re: How to get started with ... everything?

Post by SparkOut » Thu Jan 18, 2018 11:21 pm

Well I have completed the conversion of all the library functions for the K8055D.dll and can get and set all inputs and outputs, with the exception of the two readback functions.

I will need to read more, but I can't see where things are going wrong at the moment. If I introduce LCMark's _ReadBackAnalogOut function with its foreign data type declaration, Livecode just crashes off the screen. Some further guidance here would be gratefully appreciated.


EDIT: OK, brainwave... the foreign data type declaration was set as "private" - changing this to "public" to make the definition available to the handler has allowed it to work successfully.

I now have a complete interface to the board accessing all the dll functions directly from LCB. YAY! Thank you so much for your help! This has really triggered me to get invested with LCB and I will try hard to find time to study and learn, but I am so, so, so much more able to see where to head than before, although I know I will hit many brick walls very hard.

Thank you to everyone who helped, especially LCMark

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

Re: How to get started with ... everything?

Post by livecodeali » Fri Jan 19, 2018 4:25 pm

I'm glad you figured that out - it is in fact a known issue that didn't have a bug report! I've added one now.
http://quality.livecode.com/show_bug.cgi?id=20889

Post Reply

Return to “LiveCode Builder”