Re: Testing for NULL

new topic     » goto parent     » topic index » view thread      » older message » newer message
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.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu