Announcement

Collapse
No announcement yet.

How to detect an invalid symbol?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to detect an invalid symbol?

    I've written functions to derive symbols based off of other symbols (i.e. spreads to outrights and vice/versa) and am finding that there's no possible way to detect if a symbol is even valid before calling sym(). Exception handling doesn't seem to work either.

    Code:
    try {
        sym(potentially_invalid_symbol);
    } catch (err) {
        sym(other_symbol);
    }
    Does not work for me as a method of trapping it either. The script just dies with an error. I'd prefer to not have to use an exception if there were another way anyway.
Working...
X