API

Richmond richmondmathewson at gmail.com
Mon Mar 23 15:19:23 EDT 2015


On 23/03/15 12:30, Peter TB Brett wrote:
> On 2015-03-22 22:59, Peter W A Wood wrote:
>> Richmond
>>
>> I believe that Richard’s “providing OS API access” is a
>> simplification, probably an over simplification, of “providing the
>> ability to access the OS API”. As I understand, LiveCode Builder will
>> allow us to write code which can directly call an OS API but, of
>> course, we will need to define the OS API function in LiveCode
>> Builder.
>>
>> I had a quick scan of the LiveCode Builder files in Github but didn’t
>> see any examples so the facility may not even be in the current
>> release .
>
> https://github.com/runrev/livecode/blob/develop/tests/lcb/_testrunner.lcb#L44 
>
>
> It's in there.
>
>                   Peter
>

Obviously there is a socking great hole in my education as I cannot for 
the life of me
see how I can use that information:

"foreign handler __system(in Command as ZStringNative) returns CInt 
binds to "system"
handler Shell(in pCommand as String) returns Number
variable tExitStatus as Number
put __system(pCommand) into tExitStatus
if tExitStatus is in [0, -1] then
return tExitStatus
end if
if the operating system is "linux" then
-- Basically the WEXITSTATUS macro from C...
return tExitStatus shifted right by 8 bitwise
else
return tExitStatus
end if
end handler"

to hook onto an API . . .

Richmond.




More information about the use-livecode mailing list