Jump to content
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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