If len(dat) > 0 then
' c'è qualcosa...
end if