Grasshopper

algorithmic modeling for Rhino

Hey everyone,

I'm wondering what the term is for checking if an integer (or double) input is null in a custom VB component.

I though is was "Nothing" but 0 counts as nothing so that doesn't do the trick.

Thanks,

-Brian

Views: 477

Replies to This Discussion

Hi Brian,

You can't. Numbers are structures so you can use Integer (System.Int32) as value but not as reference. This implies that there is no Nothing/null for it. You could instead use Object, and the value will be boxed into a reference, so there will be Nothing again.

If you were writing the code, then the solution would be to use Nullable(Of Integer). But this is not the case in the input of the function of the custom scripting component.

Thanks,

- Giulio
_______________
giulio@mcneel.com

Ok thanks Giulio

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service