passing hex value to an external.bundle

If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.

Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.

Moderator: Klaus

Post Reply
Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

passing hex value to an external.bundle

Post by Thierry » Fri Aug 14, 2020 8:52 am

Hi,

I'm coding a C++ external with:

MacOS Mojave, LC 9.6.0, Xcode 11.3.1


Passing hex value to a function() of the external ( .bundle),
0x0A is transformed to 0,
0x0B to 1,
0x3E to 48,...

in LC:

get test( 0x09, 0x0A, 0x0B )

in lcidl:
function test
in v0 as integer
in v1 as integer
in v2 as integer
return boolean

in Xcode:

sunnYscrrenshot 2020-08-14 à 09.19.17.jpg
Xcode debugger
sunnYscrrenshot 2020-08-14 à 09.19.17.jpg (14.23 KiB) Viewed 2661 times
sunnYscrrenshot 2020-08-14 à 09.18.49.jpg
Xcode debugger
So, I get a wrong value at fetch_int(...).


get test( 10, 11, 12) // works as expected.


Any thoughts?

Thierry
Last edited by Thierry on Fri Aug 14, 2020 11:44 am, edited 2 times in total.
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am

Re: passing hex value to external

Post by sphere » Fri Aug 14, 2020 10:22 am

I did something in the past with sending HEX to a Touchscreen, which worked OK.
I don't have it with me right now. But i can post it later.

Anyway, can you clearify what your are actaully asking? Because only the question "any thoughts?" does not ring a bell. I have many thoughts during the day.
So let us know what you exactly mean :)

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: passing hex value to external

Post by Thierry » Fri Aug 14, 2020 10:28 am

sphere wrote:
Fri Aug 14, 2020 10:22 am
I did something in the past with sending HEX to a Touchscreen, which worked OK.
I did too and I was used to get right values.
Because only the question "any thoughts?" does not ring a bell.
Sorry, if this was not clear; I guess the word 'external' was too wild...

In the OP context, it's all about passing hex value to a C++ external,
using the lcidlc compiler.
fetch_int() is a function from LiveCode, and it doesn't give the right value;
nothing more to say really, as long as one know how to build an external...

and the screenshots show clearly the problem I'm facing.

Regards,

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: passing hex value to an external.bundle

Post by bn » Fri Aug 14, 2020 12:09 pm

Hi Thierry,

maybe you can also post to

https://gitter.im/LiveCode/Lobby

e.g. Monte, Trevor, and Paul McClernan visit Gitter regularly.

Kind regards
Bernd

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am

Re: passing hex value to an external.bundle

Post by sphere » Fri Aug 14, 2020 12:55 pm

Sorry, can't be of any help there i guess.

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: passing hex value to an external.bundle

Post by Thierry » Fri Aug 14, 2020 1:03 pm

sphere wrote:
Fri Aug 14, 2020 12:55 pm
Sorry, can't be of any help there i guess.
No problem, and thank you :)
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: passing hex value to an external.bundle

Post by Thierry » Fri Aug 14, 2020 1:05 pm

bn wrote:
Fri Aug 14, 2020 12:09 pm
Hi Thierry,

maybe you can also post to

https://gitter.im/LiveCode/Lobby

e.g. Monte, Trevor, and Paul McClernan visit Gitter regularly.

Kind regards
Bernd
Vielen Dank, Bernd,

Didn't know about this one; I'll give a try....

I did post here, as I guess edinbourgh's Gods are watching...

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: passing hex value to an external.bundle

Post by bn » Fri Aug 14, 2020 1:48 pm

Thierry wrote:
Fri Aug 14, 2020 1:05 pm
I did post here, as I guess edinbourgh's Gods are watching...


The Edinburgh Gods are busy. As all real Gods are.
Theodicy: It is to answer the question of why a good God permits the manifestation of evil, thus resolving the issue of the problem of evil.
(https://en.wikipedia.org/wiki/Theodicy)
:)

Kind regards
Bernd

Post Reply