LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String to Enum With Empty String Error

I have what I think is a bug, but you could also argue this isn't a great design. I have an enum that has the first value an empty value.  If I convert that to a string, it returns an empty string.  So far so good.  But if you then use the Scan From String to turn it back into an enum, it generates an error. I have a VIM for doing XML reading and conversion to a data type and this is generating an error.  Attached is a VI showing the behavior.  Is this the expected behavior? Is there a better work around?  At the moment if the string is empty, I have it then look for for each of the string values for each of the enum values and seeing if one is empty.

0 Kudos
Message 1 of 4
(188 Views)

Does it have to be an empty string?

Can you use character 127?  It looks blank.

0 Kudos
Message 2 of 4
(114 Views)

Here it is with the 1st element as chr 127.

0 Kudos
Message 3 of 4
(113 Views)

Thanks for the suggestion. Yeah I have several work arounds, but I just didn't know it would behave this way.

0 Kudos
Message 4 of 4
(42 Views)