LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search and replace string error when negative offset is used in LV2020SP1

Hello,

I recently installed LabVIEW 2020 SP1, 32-bit, and while trying to run a program written in LabVIEW 2019, I get an error -4600 from a Search and Replace String call.

 

The error is thrown when the search start offset is negative and the search mode is set to regular expression. I am including an example below... This example does not throw an error in LV2019, but it does on LV2020.

 

Example snippetExample snippet

 

Upon a quick search, I did not find anything in the release notes nor known issues indicating a change in functionality of the Search and Replace String function, other than improvements inserting with Quick Drop.

 

Is this reproducible and is it a bug?

 

(If you are wondering why did I wire a negative value, -1, to the search offset, it is because this is the offset past replacement of another Search and Replace String).

 

Thanks,

Sergio

---
SergioR
0 Kudos
Message 1 of 6
(1,495 Views)

Hi Sergio,

 

in LV2011 and LV2017 (both 32bit) I don't get an error for your first test case (offset<0, RegEx)…

 

Maybe one more undocumented change in LV2020SP1?

 

Sergio, can you change the thread title to include "in LV2020SP1"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(1,484 Views)

LV 2020 SP1 = -4600 unknown error.  My guess is that they decided that searching a string outside of its boundaries merits an error now.  I wonder if this is because searching outside the boundaries of the string now returns a null character (or characters) which isn't allowed.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 3 of 6
(1,435 Views)

Thanks for the comments... so the behavior is different at least in 2011, 2017 and 2019, compared to 2020.

 

Hmm.. I don't see null characters at the output... despite the error, it simply returns the original string.

---
SergioR
0 Kudos
Message 4 of 6
(1,429 Views)

@SergioR wrote:

Thanks for the comments... so the behavior is different at least in 2011, 2017 and 2019, compared to 2020.

 

Hmm.. I don't see null characters at the output... despite the error, it simply returns the original string.


My guess is that you direct it to search for an offset that is negative, you are searching a part of memory that is not part of the string, itself, so maybe internally it returns a null or maybe since what is outside the memory allocated to the string is unknown, it now simply gives up returns an unhelpful error.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 6
(1,419 Views)

Oh, ok, yes... now I understand what you meant.

---
SergioR
0 Kudos
Message 6 of 6
(1,415 Views)