Hi,
this is a point I don't understand and frequently stumble over.
Function main() calls checker(). When checker() is called first, it
correctly prints the message "Some error message" and correctly returns 1.
When checker() is called within the conditional-statement, <if
checker(1)>, it also returns correctly 1 which triggers printing the
message "Check returned some other error". However, printing the
checker's message "Some error message" 'fails' or is not done. Why
is
this the case?
<hansl>
function scalar checker (scalar code)
if code
print "Some error message"
return 1
endif
return 0
end function
function void main(void)
scalar ret = checker(1)
if ret
print "Check returned some error"
# print-command in checker() properly shown
endif
# checker(1) evaluated and correctly returns '1'
# However, print-command in checker() not shown
if checker(1)
print "Check returned some other error"
endif
end function
main()
</hansl>
Thanks,
Artur