(form "00900" (size 65 21)
  (heading "CLASSIFY STRINGS BY A NUMERIC FIELD")

  (label (position  2  2) (foreground (user_option "form_text_highlight"))
         (text "Define the input files" ))
  (label (position  2  3) (text "Location" ))
  (label (position  2  4) (text "ID Range" ))
  (label (position  2  5) (foreground (user_option "form_text_highlight"))
         (text "Define the output files" ))
  (label (position  2  6) (text "Location"))
  (label (position 44  6) (text "Use descriptions"))
  (label (position  2  8) (text "Number of classification passes"))
  (label (position  4 10) (foreground (user_option "form_text_highlight"))
         (text "CLASSIFICATION PASS 1"))
  (label (position  4 11) (text "Input string range"))  
  (label (position  4 13) (text "Classifying field"))  
  (label (position  4 15) (text "Classify by"))  
  (label (position 38 11) (text "Input method"))  

  (field "in_location" (position 15  3) (display_length 26) (input allowed)
    (null disallowed) (max_length 26)
    (file (link "in_id_range") (extension "*.str"))
    )

  (field "in_id_range" (position 15  4) (display_length 32) (input allowed)
    (translate upper) (format range) (null disallowed) (max_length 32)
    (help (field "in_location")))

  (field "out_location" (position 15  6) (display_length 26) (input allowed)
    (null disallowed) (max_length 26)
    (file output (link "out_id") (extension trim "*.str"))
    )

  (field "out_id" (position 15  7) (display_length 26) 
    (foreground(user_option "form_background"))
    (background(user_option "form_background"))
    (input disallowed)
    (null allowed)(max_length 26)
    )

  (field "use_descriptions" (position 57  6) (display_length  1) (input allowed)
    (translate upper) (value_in "Y" "N")
    (default "Y")
    (null disallowed) (max_length 1)
    )

  (field "cl_grps" (position 30 8) (display_length 3) (null disallowed) (input allowed) (default "1") (low_bound 1) (format integer_4)
    )
      
  (field "str_range" (position  4  12) (display_length  14) (input allowed)
        (null allowed) (format range) (max_length 32)
        )

  (field "class_field" (position 4  14) (display_length  4) 
            (input allowed) (translate upper) (default "Z")
            (max_length 6)
            (value_in "Y" "X" "Z" "D1" "D2" "D3" "D4" "D5" "D6" "D7" "D8" "D9"
                      "D10" "D11" "D12" "D13" "D14" "D15" 
                      "D16" "D17" "D18" "D19" "D20" "D21" "D22" "D23" "D24" 
                      "D25" "D26" "D27" "D28" "D29" "D30" "D31" "D32"
                      "D33" "D34" "D35" "D36" "D37" "D38" "D39" "D40" "D41" 
                      "D42" "D43" "D44" "D45" "D46" "D47" "D48" "D49"
                      "D50" "D51" "D52" "D53" "D54" "D55" "D56" "D57" "D58" 
                      "D59" "D60" "D61" "D62" "D63" "D64" "D65" "D66"
                      "D67" "D68" "D69" "D70" "D71" "D72" "D73" "D74" "D75" 
                      "D76" "D77" "D78" "D79" "D80" "D81" "D82" "D83"
                      "D84" "D85" "D86" "D87" "D88" "D89" "D90" "D91" "D92" 
                      "D93" "D94" "D95" "D96" "D97" "D98" "D99" "D100")
    )


 (field "classification" (position 4  16) (display_length  5) (input allowed)
    (value_in "segment" "point")
    (default "point") (translate lower)
    (null disallowed) (max_length 8) 
    )

   (field "inp_meth" (position 51 11) (display_length 5) (input allowed)
       (value_in "table" "range")
       (default "table") (max_length 5)
       )

/*
** -----------------------------
** fields for table input method
** -----------------------------
*/

  (scroll_block "c_group" (position  20 14) (size 37 5) (extra  0  2)
    (scroll_size 37 100)
    (repeat interactive (grow 0 1) (instances 1 (min 1) (max 100)))
    (top
      (label (position  1 0) (text "Output"))
      (label (position  1 1) (text "String ID"))
      (label (position 12 0) (text "MIN field"))
      (label (position 12 1) (text "Value"))
      (label (position 23 0) (text "MAX field"))
      (label (position 23 1) (text "Value"))
    )
    (main
      (field "string_fd" (position 1 0) (display_length 8) (input allowed)
        (format integer_4) (null allowed) (low_bound 1)
        )
      (field "from_fd" (position 12 0) (display_length 8) (input allowed)
        (null allowed) (max_length 16) (format real_8) 
        (help (field "from_fd")))
      (field "to_fd" (position 23 0) (display_length 8) (input allowed)
        (format real_8) (null allowed) (max_length 16) 
        (help (field "from_fd")))
    )
  )

/*
** -----------------------------
** fields for range input method
** -----------------------------
*/
    (field "output_string_range_label" 
        (position 24 12)
        (display_length 20)
        (foreground (user_option "form_foreground"))
        (background (user_option "form_background"))
        (input disallowed)
        (value_in "Output string range")
        (default "Output string range")
        (dependency (value "inp_meth") == "range")
    )

   (field "string_range" (position 24 13) (display_length 26) (input allowed)
       (format range) (max_length 32) (null allowed)
       (dependency (value "inp_meth") == "range")
       )

    (field "output_grade_range_label" 
        (position 24 15)
        (display_length 20)
        (foreground (user_option "form_foreground"))
        (background (user_option "form_background"))
        (input disallowed)
        (value_in "Output Grade range")
        (default "Output Grade range")
        (dependency (value "inp_meth") == "range")
    )

   (field "grade_range" (position 24 16) (display_length 26) (input allowed)
       (format range) (max_length 32) (null allowed)
       (dependency (value "inp_meth") == "range")
       (help (field "string_range"))
   )

  (default_buttons)
)
