issettable proc
- Format:
- issettable(Var)
- Args:
- Var: The variable to test.
This returns 1 if the given variable can be set at runtime. Variables which are not const or read-only will return 1.
I think this proc would be useful as a safety check. It would have the opposite use that isnull() currently has, but would just be used less often. isnull() checks if a read value isn't safe for use in another proc, and issettable() would check if it's safe to try and overwrite a variable's value.
I looked into softcoding this proc, but it just doesn't seem possible to obtain this information, without actually generating a runtime error! The closest thing we have is the issaved() proc, but that doesn't differentiate between const and global or tmp vars, which are settable, so it really doesn't solve the problem.
Hopefully the functionality exists to allow this to be feasible.