02-04-2021 01:48 AM - last edited on 02-04-2021 09:07 AM by markwni
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.
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
02-04-2021 02:03 AM - edited 02-04-2021 02:08 AM
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"?
02-04-2021 07:09 AM - edited 02-04-2021 07:10 AM
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.
02-04-2021 08:17 AM
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.
02-04-2021 09:02 AM
@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.
02-04-2021 09:04 AM
Oh, ok, yes... now I understand what you meant.