Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Feature Request: Limit Scope of a "Find" and "Change"
#1
I have a QB64 program that I've written which is now over 14,000 lines of code. I will typically be working within a specific block of the code for extended periods of time. As an example, let's say that today I am focusing all my efforts on a block between lines 5000 to 7000. It would be great if for the Search > Find... and Search > Change... we could have an option to limit searches to specific ranges. Maybe even multiple ranges could be specified like 5000 - 7000, 8000 - 8500.

This could make a world of difference so that these operations don't take you to areas that you have zero current interest in.
Reply
#2
What might help with that is breaking the different portions into seperate library (I think .bm or .bi) files and including them. 

But if like me, you prefer all your code in one file (which eliminates dependency issues), you can add comments to the top and bottom of each section that make it easy to jump to, e.g., 
Code: (Select All)
' BEGIN MYSECTION #MYSECTION
(your code here)
' END MYSECTION @MYSECTION

' BEGIN SECTION2 #SECTION2
(more code)
' END SECTION2 @SECTION2

etc.
That way you can do a find and simply enter pound sign + {section name} to go to the top, and I think doing a search will start from that line (conversely, to jump to the bottom enter @ sign + {section name}). 

I find the QB64PE IDE to be decent, but for extensive editing of big files, I use Notepad++ which has much better editing features (including the option to search/replace in only the selected text) and then when I'm ready to compile/run, I select all, copy & paste into the IDE and run from there. 

Hope some of this helps - good luck!
Reply
#3
Under the Search Menu of the IDE there are options to set Bookmarks
Alt + left sets one
Alt + up /down navigates between them.
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#4
I also have a massive number of lines of code, before leaving my coding session I place a comment "Working Here" near the area where I either need to continue working on or near the area that I want to work on next. Then just search for Working Here. Saves me a lot of time searching (be sure and delete old Working Here markers but even then the Find Next could give you multiple locations of code that may interact with each other)
Reply
#5
(06-13-2025, 04:49 PM)hanness Wrote: let's say that today I am focusing all my efforts on a block between lines 5000 to 7000. It would be great if for the Search > Find... and Search > Change... we could have an option to limit searches to specific ranges. Maybe even multiple ranges could be specified like 5000 - 7000, 8000 - 8500.

i support this.  however the qb64 editor wasn't really designed for monolithic text files which are 2mb and larger in size.  on linux on my computers geany or kwrite.  takes several seconds to load a text file that large.

otherwise my advice is to have another program editor to hand.  like notepad++ on windows.  then search and replace within a selection could be done with those programs.  for example in geany.  just select the lines you want to search in.  then press ctrl+h.  make sure you press "in selection" button for replace.  can't tell it to focus on a range of lines.  notepad++ and scite should be similar.  since both are based on scintilla.

the qb64pe ide has the ability to search inside string literals only.  and/or comments.  i have never used this option.  because i use other text editors to compose my code.
Reply
#6
Here's a very easy idea for this:  

Open a second instance of the editor.
Cut out the segment you want to only search with CTRL-V.
Paste in the second instance.
Do the search or replace as necessary.  When finished, just paste it back to its original position.

I've actually done this for a lot of things, just because it was so much simpler to just edit inside a smaller workspace than it was to work inside a whole program all at once.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Recursion Limit bplus 14 2,436 10-17-2025, 07:46 PM
Last Post: a740g
  calculating ratios to find optimal grid layout madscijr 16 2,509 02-21-2025, 10:24 PM
Last Post: madscijr
Tongue request: anyone want to do a remake of goat simulator or desert bus? madscijr 7 1,527 10-01-2024, 04:30 PM
Last Post: SMcNeill
  Odd behavior with Search -> Change window TerryRitchie 8 1,488 05-09-2024, 05:00 PM
Last Post: bplus
  Question about Find in Search TerryRitchie 3 809 05-02-2024, 05:29 PM
Last Post: TerryRitchie

Forum Jump:


Users browsing this thread: 1 Guest(s)