; add_att { f1 f2}
;
; permits to add a peak in the current data_base
; if called without arguments, wait for a click of the user
;

if (!$arg) then
  monopoint
  set f1 = (itop($pointy[1],2,1))  set f2 = (itop($pointx[1],2,2))
else
  set f1 = $_  set f2 = $_
endif

set pic = ($att["largest"] + 1)
dialogbox ("Peak";$pic) \
   "ppm in F1" real f1 $f1 \
   "ppm in F2" real f2 $f2 \
   "spin name in F1" string sp1 "unk" \
   "spin name in F2" string sp2 "unk" \
   "note" string note "-" \
   *
set amp = (val2d(ptoi($f1,2,1),ptoi($f2,2,2)))
set att[$pic] = ($f1; $f2; $sp1; $sp2; $note)
set att["largest"] = $pic
show_att $pic
