/* TPCallback.cmd
 * handle Two Panel callback from Display Monitor
 *
 * Arguments
 *   arg(1) - the name of the application to provide details
 *
 * Copyright (C) 2005 Blonde Guy
 * All Rights Reserved
 */

pipeName = '\pipe\suntan'

if arg() = 0 then do
   return TPCallBack("no argument specified")
end

pipestate = stream(pipeName, 'c', 'open')
if left(pipestate, 8) = 'NOTREADY' then do
   say "TPCallback found the pipe not ready."
end
else do
   x = arg(1)
   cr = d2c(13)
   message = "This is a TPCallback test." || cr || cr ||,
             "TPCallback has been called with" x
   call lineout pipeName, "!tpcallback" message
end

return 0
