Jump to content
News about the LabVIEW Wiki! Read more... ×
Sign in to follow this  
Autodefenestrator

Assert enum type in VIM file

Recommended Posts

So I wanted to make a VIM that was essentially "Convert input into 1D string array".  If you passed it a 1D array of anything it would convert each element to strings (similar to the debug VIM that ships), but passing in any scalar would do assorted things depending on the scalar (single item array for things like numerics, but a Path would split into each component, and different methods for other types).

I thought it would be a good idea to have an option that if an enum is passed it, the array passed out would be the list of all of the options converted to strings.  They way to get this is "Get Numeric Information" on the Data Type Parsing palette, but it uses a Variant input and therefore allows any input.  And there was no "Assert enum" on the "Assert Type" palette.  So, I've made one:

1272328805_Assertanyenumtype.thumb.png.9089d7fed90f49ec44c8b6b02580652e.png

It seems to work with every data type I can think of, because I don't know what besides an enum is a valid input both for a %s input to a "format string" node, and can also be an input for the "split number" node. 

I was wondering if anyone else can think of anything that is a valid "%s" conversion (like string, path, VISA reference, assorted DAQmx references) that is also valid for "split number".  I am hoping to avoid discovering a data type later on that I didn't think of that also accepts this case and breaks "Get Numeric Information".

Assert Any Enum Type.vim

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.