! Tests the SAY command.
!
! Author:  J. Czechowski IV
!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE
  switch BASELINE    baseline GET DEF=FALSE SDEF=TRUE

  if interAct then
    res inst "This should say HELLO multiple times. The first two should  &
              just say 'HELLO' the third should say 'INFO: HELLO' and the fourth &
              'WARN: HELLO'."

    pipe on
      panel/msgid=MAIN/setup/controls=gc
      gcontrol label macro "MACRO"
      gcontrol menu main "Exit with Status = " "PASS,FAIL" /tleft
      set gc.main.itemColors {PASS=GREEN,FAIL=RED}
      gcontrol text idtext "INSTRUCTIONS" "^inst" 24 7 /title

      shellgui/id=idshellgui/attach
      say ""
      say "nM> SAY HELLO"
      SAY HELLO
      say ""
      say ""
      say "nM> SAY/L=F H"
      say "nM> SAY/L=F E"
      say "nM> SAY/L=F L"
      say "nM> SAY/L=F L"
      say "nM> SAY O"
      SAY/L=F H
      SAY/L=F E
      SAY/L=F L
      SAY/L=F L
      SAY O
      say ""
      say ""
      say "nM> INFO HELLO"
      INFO HELLO
      say ""
      say ""
      say "nM> WARN HELLO"
      WARN HELLO
      say ""
      say ""
    pipe off
  endif
endmacro


procedure processMessage m:msg
  !say "msg.name ^msg.name, data ^msg.data"

  if msg.name eqs "MAIN" then
    assert/text="^reg.main.name: Tests for SAY" msg.data eqss "PASS"
    pipe stop
  else
    say "^reg.main.name: Unhandled message name: ^msg.name from fid: ^msg.fid data: ^msg.data"
  endif
return
