PxPlus User Forum

Twitter Twitter Twitter

Author Topic: More Advanced Search Tool Than Integrated Toolkit  (Read 1155 times)

cole

  • New Member
  • *
  • Posts: 4
    • View Profile
More Advanced Search Tool Than Integrated Toolkit
« on: November 06, 2023, 05:00:12 PM »
Hi folks.  I came out of a BBx / BBj environment - new to PVX.  (forgive me.  :-\   ) 

We have PVX ver 14. 

Background that can be skipped:
In BBx, I created a nice program search utility that I could call, with the pgm to be searched in memory: 
WHICH_PGM$=PGM(-1)
and then get the lines of that pgm
0260 LET ALINE$=LST(PGM(WHICH_LINE,TCB(12)-1,ERR=0280))
and then write all the lines of that pgm to a text file (a memory file for PVX).


The objective is to then be able to do different search features, such as a progressive search, where you first search for STRING1, which leads you to want to search for STRING1 and STRING2, and that leads to wanting to search for STRING1, 2, and 3.  So, after each search result is displayed to the screen, you press <F1> to tell the search pgm, "Search for everything I just searched for again", and then you add the next string to include in the search results. 

Having your multiple search strings all on the screen at the same time, bolded to stand out...  You could even do a DUMPF XYZ$ to get the variable values along the way.  This could be very useful in debugging a runtime error on the fly.

The Ask:
Hoping I don't have to reinvent the wheel - have any of you created a fast editor with these kinds of features (different than the Integrated Toolkit editor,) and made it open source and/or available to the PVX community?

Thanks!
Cole

PxPlus

  • Administrator
  • Diamond Member
  • *****
  • Posts: 1091
    • View Profile
Re: More Advanced Search Tool Than Integrated Toolkit
« Reply #1 on: November 06, 2023, 05:40:47 PM »
There are any number of ways to accomplish this but the easiest might be using ED+.

Simply load the program you want and launch ED+,  Select the Edit >> Find & Replace >> Find option from the menu bar. 

This will bring up the Find window where you can enter STRING1 and press the ALL button to highlight all occurrences. 

Now if you want you can enter a regular expression, press the .* button enter PRINT|INPUT and press ALL to get all PRINT or INPUT words.  Any regular expression can be used.

There are also things like the LV command line that will list all variables.

Or if you want to migrate your utility, likely you simply have to save it in _cmd/somename then load your program and enter somename to have the system run your code.  The PGM function should work pretty much the same as BBx.  The _cmd directory should be in directory where you started PxPlus.


cole

  • New Member
  • *
  • Posts: 4
    • View Profile
Re: More Advanced Search Tool Than Integrated Toolkit
« Reply #2 on: November 06, 2023, 06:28:38 PM »
Okay, the ED+  with the ALL button did let me highlight all occurrences using a pipe for OR, which is great.  I don't suppose there is then an option to display ONLY the search results without displaying lines that do not have my search strings?

I just tried doing a boolean AND a few different ways and could not get it to work.  If I wanted to find both:

DIM  ---AND---  MYVAR

in the same pgm statement, would that be possible?   I tried:

DIM&MYVAR
DIM & MYVAR
DIM&&MYVAR

Etc.

If that is not possible, then I'm curious what a boolean AND would be used for.  An example would be great to see.

Thanks.
« Last Edit: November 06, 2023, 07:00:54 PM by cole »

Mike King

  • Diamond Member
  • *****
  • Posts: 3818
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: More Advanced Search Tool Than Integrated Toolkit
« Reply #3 on: November 06, 2023, 09:10:57 PM »
You probably should review Regular Expressions ..

Basically for what you want would be

DIM.*MYVAR

Here is a link to more details about regular expressions which are used by the MSK function:
https://manual.pvxplus.com/page/functions/msk.htm
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

cole

  • New Member
  • *
  • Posts: 4
    • View Profile
Re: More Advanced Search Tool Than Integrated Toolkit
« Reply #4 on: November 07, 2023, 02:51:11 PM »
Thanks, Mike.  Appreciated.