LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Poll: Preferred Way to Handle Offset and Length When Filtering

Thanks everyone for your feedback.  Yes the actual use of this is more complicated.  And even the file itself has compressed chunks.  So there might be 2 chunks in the file with say 100 elements in the first chunk, and 50 in the second.  I already have code optimization work so that if you read from Offset 0 and Length 10, then read Offset 10 Length 10, it will cache all the content from the first read into a DVR so it doesn't need to read it from the file again.

 

So applying the filter before the read would mean more things to keep track of.  Not only the total items in each chunk of the file, but the number of matching in each chunk.  It adds lots of more complexity when honestly the most common use for this function would work fine if the filtering was done after the read.  T his will mean that with a Length of 10 you may end up with between 0 and 10 items returned.  One issue this could cause is with the previous revision of the API you could just us an "Empty Array?" function on the output and assume the file is done reading if that is true.  And now you can't rely on that and need to rely on the already present "End Of File" output.

 

So I think the approach I'm going to go with at the moment is the easiest and that is to basically rename the Offset and Length to be Search Start, and Search Length.

0 Kudos
Message 11 of 11
(296 Views)