RosettaCodeData/Task/Use-another-language-to-call-a-function/Phix/use-another-language-to-call-a-function.phix
2024-10-16 18:07:41 -07:00

11 lines
347 B
Text

without js -- (peek/poke, call_back)
constant Here_am_I = "Here am I"
function Query(atom pData, pLength)
integer len = peekNS(pLength,machine_word(),0)
if poke_string(pData,len,Here_am_I) then
return 0
end if
pokeN(pLength,length(Here_am_I)+1,machine_word())
return 1
end function
constant Query_cb = call_back(Query)