DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to check whether a string is empty?

Solved!
Go to solution

How do I check whether a string is empty? Or if a string is only full of NOVALUE/Null values?

 

For example, if I have a channel that malfunctioned and didn't record any data, the whole channel is empty/null/novalue. And I want to be able to delete that bad dataset. Below is some pseudo-code of what I'm trying to do:

 

i=1

Do while i <= GroupNumber

If String is empty then

Call GroupDel(i)    'delete current group

else

i = i +1    'move on and check next group for bad data

end if

loop

0 Kudos
Message 1 of 2
(2,541 Views)
Solution
Accepted by topic author nicklausar

You can check if there are any NOVALUEs in the channel by calling

Channel.NoValues()

This will return "-1" if there are any NOVALUEs in that channel and you can delete it.  If you are working with only numeric channels and want to make sure that the entire channel is NOVALUEs, you can simply check the max or min values and if they are NOVALUE then the whole channel is empty.

Message 2 of 2
(2,490 Views)