/* Return Flags More readably */

address spot
options results

FLAGS=''

'getmessageflags'

dat=result

if testbit(1) then FLAGS = FLAGS ||"CRASH "
if testbit(2) then FLAGS = FLAGS ||"UNREAD "
if testbit(3) then FLAGS = FLAGS ||"EXPORT "
if testbit(4) then FLAGS = FLAGS ||"FATTACH "
if testbit(7) then FLAGS = FLAGS ||"KILLSENT "
if testbit(9) then FLAGS = FLAGS ||"HOLD "
if testbit(16) then FLAGS = FLAGS ||"UNREPLIED "
if testbit(17) then FLAGS = FLAGS ||"KEEP "

flags=strip(flags)

exit flags

testbit: procedure expose dat

parse arg bit

wibble=0
if dat>=(2**bit) then if bittst(x2c(d2x(dat)),bit) then wibble=1

return wibble