return 0 if 'noout' is used and no error has occurred