##- # Author: Brian Tiffin # Dedicated to the public domain # # Date: November 2016 # Modified: 2016-11-27/04:13-0500 ##+ # # EvSend.icn, demonstrate Execution Monitoring event send # Needs 1to4.icn as the monitoring target # # WARNING: This is not a safe example, still learning # $include "evdefs.icn" link evinit, printf procedure main() # initialize the Target Process EvInit("1to4") # loop across the execution events perline := 0 while ec := EvGet() do { # keep a neat event code display if (perline +:= 1) > 16 then write() & perline := 1 if ec == E_Fret then perline := 1 # event code display in octal to match evdefs defines printf("%03o ", ord(ec)) # # DON'T DO THIS AT HOME # # if the current event is a conversion attempt for the 3 # being working on in 1to4, tell the co-expression the # the conversion failed, (this skips over a conversion target # event) probably bugging out the VM # if ec == E_Aconv & &eventvalue === 3 then { writes("sending a conversion fail event, returned: ") write(image(EvSend(E_Fconv, &eventvalue, &eventsource))) } } write() end