Find and Search and Replace nothing like is PrimalScript

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
DrewEaston
Posts: 48
Joined: Mon Mar 12, 2007 4:43 pm

Find and Search and Replace nothing like is PrimalScript

Post by DrewEaston » Wed Jun 26, 2019 12:04 pm

Product, version and build: PowerShell Studio (year does NOT matter)
32 or 64 bit version of product: 64bit (I am sure this does NOT matter either)
Operating system: 64bit (again doesn't matter)
32 or 64 bit OS: Windows 7 and Windows 10 (also does NOT matter)

I have been using PrimalScript (PS) since 2002.

I have, within the last two months, started working MUCH more with PowerShell Studio (PSS)(PowerShell is the way of the future).

Being as I am coming from PS am am VERY used to the way the <Crtl>+F and Ctrl>+H work there and it is just engrained in my programmers DNA now.

When I try to use these normal functions in PSS I am constantly confronted with the lack of workableness :roll: of these dialogs.

Let me give you a few points.

If you want to refactor a small piece of code by renaming one of more variables in it, in PS you would mark that section of code the same way as you would if you were going to copy it. Then you press <Ctrl>+H and the "Replace" dialog pops up with the "Scope" radio button already set for me because, logically, NO ONE is going to search and replace an entire section.
The focus is set to the EMPTY "Find What:" textbox and away we go... fast and efficient :D

In PSS on the other hand, after marking the code I want to Find and Replace in & hitting the <Ctrl>+H keys the "Find/Replace" dialog pops up, and has thrown then entire marked text into the "Find What:" textbox. The "Search in selection" checkbox is NOT set! :?
NOT Fun! Who would EVER want to do that, I ask? :roll:

Another thing that the PSS "Fine/Replace" functionality does wrong has to do with the "Replace with:" textbox contents.

If I have completed a previous Search and Replace operation and want to do another one where I mark some NEW text the "Find/Replace" dialog pops up when called also correctly with the NEW marked text in the "Fine What:" textbox BUT the "Replace with:" textbox still has the OLD information in it. That is one problem the other problem with the OLD text is that when I <TAB> from the "Find What:" textbox to the "Replace with:" textbox the cursor is placed in a random position in the OLD text. If the OLD text was very long and the NEW text is shorter the cursor is somewhere in the middle. I have NOT been able to determine what value is being used for that position but I am sure your programmers will find out when they reproduce this behavior.
(I think that the position is the end of the "Find What:" text length)

In my opinion when a NEW "Find" or "Fine & Replace" is started the "Replace with:" textbox should be cleared!
When more than ONE (1) word is marked, delimited using spaces, and <Ctrl>+H was pressed then the "Find What:" textbox AND the "Replace with:" textbox should be cleared. as well as setting the CheckBox "Search in selection" automatically.

I am surprised that NO ONE else has complained about this lack of functionality.

I hope that you DON'T say again that "other" editors work this way.

Note: NotePad++ would in such a case ONLY put the entire first line of the marked text into the "Find what:" textbox but that is dumb also.
(PSS puts the ENTIRE marked text into the textbox (worse))

If they do work that way you know why I don't use them and use SAPIEN instead.
As I said before, I have been programming VBS since 2002 with PrimalScript, the ONLY runtime VBS debugger on the market that is worth ANYTHING.
And it is worth MORE than it's weight in GOLD.
(I don't know what software weighs, I would say nothing :lol: )

Have fun,
Drew

User avatar
brittneyr
Site Admin
Posts: 234
Joined: Thu Jun 01, 2017 7:20 am

Re: Find and Search and Replace nothing like is PrimalScript

Post by brittneyr » Wed Jun 26, 2019 1:17 pm

Thank you for your feedback. We are looking into this and will keep you updated.
Brittney Ryn
SAPIEN Technologies, Inc.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Find and Search and Replace nothing like is PrimalScript

Post by davidc » Thu Jun 27, 2019 8:26 am

PowerShell Studio has a rename refactoring feature:
Rename Refactor.png
Rename Refactor.png (25.8 KiB) Viewed 2145 times
This feature will update functions, parameters and variables. It will even update references across files within a project.
David
SAPIEN Technologies, Inc.

User avatar
DrewEaston
Posts: 48
Joined: Mon Mar 12, 2007 4:43 pm

Re: Find and Search and Replace nothing like is PrimalScript

Post by DrewEaston » Thu Jun 27, 2019 11:33 am

Hi David,

Thanks for that information, I did NOT know that and that is a GREAT thing to have.
I will start using that for the overall refactoring tasks.
(I also like the fully automatic refactoring that SAPIEN does when I rename anything in the GUI element properties during the Design work/rework, that is simply FANTASTIC, just like it should be :) )

But there are times when I copy a piece of code while I am going experimental programming and I take something in the current program/script copy it to a new place and then I want to rename some of the variables in ONLY that small section of the code and NOT the entire script or project.

There are other reasons why the Find/Replace dialog logic must be fixed. The main one for me is when using the other Flagship product from SAPIEN the handling and functionality of scripting should be as close possible to each other without blocking future improvements in either. PowerShell Studio is the new Flagship product next to PrimalScript. Both have earned their positions with the GREAT programming of the SAPIEN Team and the help they give us other programmer BUT PrimalScript was here first and MUCH longer.
(I don't know which one has more customers but you guys do)

I thought long and hard before opening this incident. I came to the conclusion to open it because the, better, Find/Replace handling from PrimalScript is just in my programmers DNA and I need to and MUST write PowerShell scripts because that is the future and I now have the hang of the GUI programming of PowerShell Studio. It is JUST painful to use these new reworked and NOT vary capable Find/Replace functions. :(

So the refactoring feature only helps if I am refactoring the variable through the entire file/project but not in smaller sections inside of those :-)

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Find and Search and Replace nothing like is PrimalScript

Post by davidc » Thu Jun 27, 2019 12:33 pm

We certainly will look at improving the Find/Replace dialog. Your candid feedback is very much appreciated.

Quick Tip: If you wrap the experimental code with in a function, the refactoring will only be applied within the function's body.
David
SAPIEN Technologies, Inc.

User avatar
brittneyr
Site Admin
Posts: 234
Joined: Thu Jun 01, 2017 7:20 am

Re: Find and Search and Replace nothing like is PrimalScript

Post by brittneyr » Mon Jul 15, 2019 3:20 pm

Please try the latest service build of PowerShell Studio (v166).
Brittney Ryn
SAPIEN Technologies, Inc.

User avatar
DrewEaston
Posts: 48
Joined: Mon Mar 12, 2007 4:43 pm

Re: Find and Search and Replace nothing like is PrimalScript

Post by DrewEaston » Tue Jul 16, 2019 10:39 am

Hi Brittney,

Look GREAT and works GREAT, thanks a lot this will make programming with PSS much more enjoyable :D