! Tests the QUERY command
!
! @author  J. Czechowski IV
!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE
  switch BASELINE    baseline GET DEF=FALSE SDEF=TRUE


  set myString "a string"
  if interAct then
    res inst "The methods matching 'subString' in the String class (might not have &
              any docs), the documentation for the constant 'PI' and the 'join' &
              method in the String class, and the constructors for java.net.URL & 
              should be shown on the right. It is normal for the constructor to say &
              'Javadoc file not found'. &
              Lastly you should see documentation for FileName.toURL(..)."

    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 20 /title

      shellgui/id=idshellgui/attach
!warning "JPH -- I had to put a pause in here or no text showed up!!!"
!pause 1
      say ""
      say "nM> QUERY myString substring"
      QUERY  myString substring
      say ""
      say "nM> QUERY nxm.sys.inc.Constants PI"
      QUERY  nxm.sys.inc.Constants PI
      say ""
      say "nM> QUERY nxm.sys.lib.StringUtil join"
      QUERY/nr=200 nxm.sys.lib.StringUtil join ! Use /nr=999 to show all rows
      say ""
      say "nM> QUERY java.net.URL <init>"
      QUERY java.net.URL <init>
      say ""
      say "nM> QUERY nxm.sys.lib.FileName toURL" ! <-- Test for Bug 1721
      QUERY nxm.sys.lib.FileName toURL           ! <-- Test for Bug 1721
    pipe off
  else
    ! VERSION is tested only in an interactive mode
  endif

endmacro


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

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