jhenise Posted April 11, 2018 Share Posted April 11, 2018 for editing in sequences and edit boxes a find and replace feature would be nice... helpful for editing a lot of redundant code where a number or name needs to be changed in many places... Link to comment Share on other sites More sharing options...
AzeoTech Posted April 13, 2018 Share Posted April 13, 2018 You mean across all, not just one sequence I'm assuming since that already exists. BTW: it's generally considered good coding practice to avoid "magic numbers". These are numbers that you might want to change in many places. Instead you should use DAQFactory's define to create a name for your constant. Then you can just change that in one place. So for example: define NumberOfTanks = 4 define string AppName = "My App" You can then use these anywhere you would use a variable, except on the left side of an equal sign, or any other place where it would be changed. The only way to change a defined variable is to define it again. Link to comment Share on other sites More sharing options...
jhenise Posted April 23, 2018 Author Share Posted April 23, 2018 I can hit ctl+F within a sequence and it opens the find feature, but I don't see any replace option.... Anyway its not to big of a deal, i realized that you can just paste the script into Microsoft word and use the find and replace features in there... What brought this up was I had mad an application with 20 temperature channels, and had written some long sequences to do things with them. I then make 20 humidity channels and duplicated the sequences to have the same functions for the humidity channels. this resulted in me having to change the word Temp to Humid in about 100 places in the scripts. just using the word processor made it super easy. I could have made a private string within the sequences for the names perhaps if i was thinking ahead. thanks for the input.... Link to comment Share on other sites More sharing options...
AzeoTech Posted April 23, 2018 Share Posted April 23, 2018 Replace is in the Edit menu with Find and has a shortcut key of Ctrl-H. I'm not sure why that shortcut was chosen, but I believe it matches up with an old version of Word, or maybe the Visual C++ editor. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.