;
if (!$arg) then
  formbox 'Read file' \
   'read_file "Read" $f' \ 
   'choose file' enum $list_spectra f % \
   'Read' action 'read_file "Read" $f ' noreturn \
   'Showc' action 'join ("spectra/" // $f) showc %' \
   *
else
  set act = $_
  set f = $_
  set ff = ("spectra/" // $f)
  if ($act s= "Read") then
    read $ff
    set cur_exp := $ff
    set cur_db := ("db/" // $f)
	if (dbm("att")) dbclose att
    dbopen $cur_db att
; check if it is the first time
    if (!exist("att[LARGEST]")) set att["LARGEST"] = 0
    dialogbox data-file \
      ("Data-set :" ; $ff) message \
      ("Size :"; $si1_2d; "x"; $si2_2d) message \
      ($att["LARGEST"]; "peaks in data-base") message \
      *
  else
    join $ff showc %
  endif
endif
