(form "00901" (size 59 14)
  (heading "CLASSIFY STRINGS BY A NUMERIC FIELD")

  (field "head_str" (position  1 2)
     (display_length 30)
     (foreground (user_option "form_text_highlight"))
     (background (user_option "form_background"))
     (input disallowed)
   )

  (label (position  1 4) (text "Input string range"))  
  (label (position  1 6) (text "Classifying field"))  
  (label (position  1 8) (text "Classify by"  ))
  (label (position 35 3) (text "Input method"))  


      (field "str_range" (position  1  5) (display_length  14) (input allowed)
        (null allowed) (max_length 32)
        )

      (field "class_field" (position 1  7) (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 1  9) (display_length  5) 
         (value_in "segment" "point")
         (default "point") (translate lower) (input disallowed)
         (null disallowed) (max_length 8) 
         )

      (field "inp_meth" (position 48 3) (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 6) (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) 
        (initialise (value "to_fd(-1)"))
        (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 4)
        (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 5) (display_length 26) (input allowed)
       (format range) (max_length 32) (null allowed)
       (dependency (value "inp_meth") == "range")
       )

    (field "output_grade_range_label" 
        (position 24 7)
        (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 8) (display_length 26) (input allowed)
       (format range) (max_length 32) (null allowed)
       (dependency (value "inp_meth") == "range")
       (help (field "string_range"))
   )

   (menu (position 5  12) (size 13 1)
     (item (function "next_button") (text "Next") 
     )
   )
   (menu (position 23 12) (size 13 1)
     (item "help_button" (function "help_button") (text "Help") 
     )
   )
   (menu (position 41 12) (size 13 1)
     (item (function "previous_button") (text "Previous") 
     )
   )
)
