06-15-2021 04:21 PM - edited 06-15-2021 04:23 PM
Hello,
Is there a faster way of finding and (more importantly) replacing hidden text in LabVIEW
I have a text that I need to replace in about a 100+ places and the text in question is hidden under an enum constant.
I can find the text one by one and edit the name under properties for each enum constant but a replace all or even a replace text does not work for hidden texts.
Thank you
K
06-15-2021 05:39 PM
What kind of text are you referring to?
06-16-2021 03:06 AM - edited 06-16-2021 03:07 AM
@Kaizen14 wrote:
Hello,
Is there a faster way of finding and (more importantly) replacing hidden text in LabVIEW
I have a text that I need to replace in about a 100+ places and the text in question is hidden under an enum constant.
I can find the text one by one and edit the name under properties for each enum constant but a replace all or even a replace text does not work for hidden texts.
Thank you
K
I'm guessing you are talking about editing enum items. This is ugly, and I guess every LabVIEW programmer has to live through this. Once. Hopefully this will teach you to typedef at the very least an enum that is going to be used in more than one place. (I normally just automatically typedef an enum because I've never met one that I used only once.)
06-16-2021 08:18 AM
In the Find window, click More options and activate 'Look in hidden text'
06-16-2021 08:22 AM
Thank you Yamaeda,
I activated the 'Look in hidden text'. Its just that even after doing that, it does not replace with the text I want. I have to go to each instant a select the text from the drop down I want and then I can replace it
06-16-2021 08:26 AM
Thank you bilko,
Yes I agree with you. This is a legacy program I am in charge of modifying and looks like the original programmer opted against typedef and so I am kind of stuck.
I was looking for a faster way of editing the enum keeping this in mind.
Looks like I will have to slog through this and in the meanwhile I can make it as typedef to save the future programmer the same issues.
I appreciate you suggestion.
06-16-2021 08:27 AM
Hi Paul,
Yes these are strings of an enum constant and it is not typedef'd unfortunately.
06-16-2021 10:25 AM
I guess you've already thought about it, but if you create the Type def, you can then do a search for this text and use ctrl+g to step between the instances and easily paste/replace the enum with the type def. Then you can update the typedef with the changed text.
06-16-2021 01:05 PM
You could also make a VI using Scripting that'll look for all instances of enums, then check to see if it's the right enum, and replace it with a typedef. That would solve two of your problems.
06-16-2021 07:01 PM
@Kaizen14 wrote:
Thank you bilko,
Yes I agree with you. This is a legacy program I am in charge of modifying and looks like the original programmer opted against typedef and so I am kind of stuck.
I was looking for a faster way of editing the enum keeping this in mind.
Looks like I will have to slog through this and in the meanwhile I can make it as typedef to save the future programmer the same issues.
I appreciate you suggestion.
A long time ago I created a VI that automated that process. I'll rummage around for it.