Re: Testing for NULL
- Posted by jimcbrown (admin) Sep 02, 2015
- 1887 views
xecronix said...
#!/usr/bin/env eui sequence x -- The next executable line is an error as expected. -- But, how can I test/defend against this error in advance? -- ie -- -- if x = ??? then -- -- do something -- end if printf(1, "x is %s", {x}) -- How to test for this error?
Only works in 4.0.0 and above - use object.
#!/usr/bin/env eui sequence x -- The next executable line is an error as expected. -- But, how can I test/defend against this error in advance? -- ie -- if not object(x) then -- do something end if printf(1, "x is %s", {x}) -- How to test for this error?
xecronix said...
-- I don't know how to express this in Euphoria either. -- What I hoped for was a way to set x to some value -- after valid assignment that would cause the error at the -- start of the code. x = 0 -- This causes a type error. But how do you unset a variable? printf(1, "x is %s\n", {x})
This isn't supported.