{--------INPUT_LTAB----------------------------TIM SHARP----------}
{AN ALTERNATIVE TO INPUTTING AN LTAB - OVERCOMES INPUTTING PROBLEMS
NOTE THE FILE MUST EXIST - THIS MACRO DOES NOT CHECK - IF NOT IN CURRENT
DIRECTORY, IT REQUIRES A FULL PATHNAME AS PARAMETER
}

define input_ltab
  local st_rows local st_cols local st_row local st_col
  local st_line local st_data
  parameter ltab_fname
  display_no_wait 'CREATING DATA TABLE FROM FILE'
  OPEN_INFILE 1 ltab_fname
  read_file 1 st_line
  read_file 1 st_line
  read_file 1 st_line
  let st_line (trim (substr st_line (pos st_line ' ') (len st_line)))
  let st_rows (val(trim (substr st_line 1 (pos st_line ' '))))
  let st_line (trim (substr st_line (pos st_line ' ') (len st_line)))
  let st_cols (val(trim (substr st_line 1 (pos st_line ' '))))
  let st_line (trim (substr st_line (pos st_line ' ') (len st_line)))
  let st_ltab_name (substr st_line 2 ((len st_line) - 2))
  create_ltab st_rows st_cols st_ltab_name
  read_file 1 st_line
  read_file 1 st_line
  loop
  exit_if ((substr st_line 1 6) = 'DELETE')
    read_file 1 st_line
    if ((substr st_line 1 4) = 'Wd_ ')
      let st_line (trim (substr st_line (pos st_line ' ') (len st_line)))
      let st_row (val(trim (substr st_line 1 (pos st_line ' '))))
      let st_line (trim (substr st_line (pos st_line ' ') (len st_line)))
      let st_col (val(trim (substr st_line 1 (pos st_line ' '))))
      let st_data (trim (substr st_line (pos st_line ' ') (len st_line)))
      if ((substr st_data 1 1) = "'")
        let st_data (substr st_data 2 ((len st_data) - 2))
      else
        let st_data (val st_data)
      end_if
      write_ltab st_ltab_name st_row st_col st_data
    end_if
  end_loop
  close_file 1
end_define

Home | About Us | Services Summary | Web Design | Villa Websites | Imaging | Search Engine Work | e-commerce | CAD Programming | Links to Our Sites | View Shopping Cart | Contact Us |