home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6571.LZX / extras / ttx / rexx / ttx_sasc / StartSCMsg.ttx < prev   
Encoding:
Text File  |  1996-12-24  |  885 b   |  35 lines

  1. /*
  2. **  $VER: StartSCMsg.ttx 2.1 (17.8.93)
  3. **      By Kenneth Yarnall.  This code may be freely distributed
  4. **
  5. **  Starts SCMsg, placing it on the public screen named by the single
  6. ** argument.  If SCMsg is already running, moves it to the public screen
  7. ** that is passed in.
  8. */
  9.  
  10. StartSCMsg:
  11. Options RESULTS
  12.  
  13. Parse ARG pubscrname
  14.  
  15. /* If there wasn't a screename passed in, get one from ttx. */
  16. if pubscrname = "" then do
  17.     GetScreenInfo
  18.     Parse VAR RESULT . '"' pubscrname '"'
  19. end
  20.  
  21. if ~show('P', 'SC_SCMSG') then do
  22.     Address COMMAND
  23.     'run sc:c/scmsg SCREEN ' || pubscrname  /* run scmsg */
  24.     'WaitForPort' 'SC_SCMSG'    /* WaitForPort needs to be in the path */
  25.     Address
  26.     if RC ~= 0 then do          /* couldn't find scmsg */
  27.         SetStatusBar "Couldn't find SCMsg -- aborting"
  28.         Return 10
  29.     end
  30. end
  31. else
  32.     Address SC_SCMSG 'opts screen ' || pubscrname
  33.  
  34. Return
  35.