I am trying to write some Fire code based on whether an environment variable exists (like if (defenv(MYVAR) && envval(MYVAR))). Is there a Fire command to find out if an environment variable is defined before using envval on it?
You can actually define your own function to do this by taking advantage of the err_level system identifier which filters out error messages above a given threshold of severity (1=most severe, 10=least severe). The Environment Variable undefined message is a severity 6 message – so setting err_level to 5 will stop it appearing.
Related Questions
- I am trying to write some Fire code based on whether an environment variable exists (like if (defenv(MYVAR) && envval(MYVAR))). Is there a Fire command to find out if an environment variable is defined before using envval on it?
- Is my cell phone usage taxed based on area code or billing address?
- Why should an ASIC designer write code that can target an FPGA?