Programmers editor with...?

Utilities like DBU, Make, IDE written in HMG/ used to create HMG based applications

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Programmers editor with...?

Post by Roberto Lopez »

Hi All,

I'm looking for a text editor supporting (besides file name) a search expression as command line parameter and if it is found, position the cursor there.

I'm googled this, but found nothing...

TIA.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
serge_girard
Posts: 3162
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Programmers editor with...?

Post by serge_girard »

We had one on the mainframe: SPF
I have a very very old DOS SPF-PC version, I don't know if it is still working...

Serge
There's nothing you can do that can't be done...
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Programmers editor with...?

Post by trmpluym »

Roberto,

Why not create your own using the wonderfull:

c:\hmg.3.4.3\SAMPLES\HFCL\WordScribe

Theo
User avatar
CalScot
Posts: 303
Joined: Thu Mar 21, 2013 12:22 am
Location: California

Re: Programmers editor with...?

Post by CalScot »

I'm looking for a text editor supporting (besides file name) a search expression as command line parameter and if it is found, position the cursor there.
I sometimes still use an old DOS-based program called XyWrite (from about 1987?) from a company called XyQuest.
It's an amazing piece of software, blindingly fast, entirely command-line driven (which is maybe why it never really caught on?) and I think it will do exactly what you're looking for.
I just Googled it and there seem to be Windows versions. I haven't tried them, but they might be a good place to start your search.
Good luck
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Programmers editor with...?

Post by andyglezl »

Maybe this...

https://www.powergrep.com/manual/commandline.html

o with

findstr /l /n /c:"Darwin" *.docx ...... and somehow open the editor
findstr-dos.jpg
findstr-dos.jpg (53.47 KiB) Viewed 8507 times
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Programmers editor with...?

Post by Roberto Lopez »

Thanks for all the answers.

Some of you could be wandering why I'm asking for this...

I have a big project (more than 400 prgs).

It was created with IDE. So, each event procedure has its own prg file (I'm the culprit of this :) ).

This approach is very useful and worked fine... until...

I've integrated (joined) this project with another one, so the total prg count raised to about 600...

Then... the project can't be built anymore (building process simply does not work).

Since I've was very rushed (I've needed to make work the new integrated project in a couple of days) I've simply put all the prgs of the new project together in only one.

Then, all worked well, but, since the project is in permanent expansion (five years and counting) every time I add a new event procedure, I must do it manually, to a big prg containing all new ones.

So... jump to the exact point in the file, specifying the procedure name as a parameter could be very helpful...

I'll try your suggestions... Thanks again.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Tiger
Posts: 70
Joined: Mon Aug 31, 2015 11:28 am
Location: Taipei

Re: Programmers editor with...?

Post by Tiger »

How about this ... ( I got it from Google )
and it works on my PC with notepad++
=============================
script.bat ==>

@ECHO OFF &SETLOCAL
set "LineNr="
for /f "tokens=1*delims=[]" %%a in ('^<"%~1" find /i /n "%~2"') do if not defined LineNr (
set "LineNr=%%a"
SET "Line=%%b"
)
if not defined LineNr (
set "LineNr=1"
SET "Row=1"
GOTO :launch
)
CALL SET "Right=%~2%%Line:*%~2=%%"
CALL SET "Line=%%Line:%Right%=%%"
FOR /f "delims=:" %%a in ('"(echo("%Line%"&@echo()|findstr /o $"') do SET /a Row=%%a-4
GOTO :launch
:launch
START /b CMD /c ""c:\Notepad++\notepad++.exe" -n%LineNr% -c%Row% "%~1""
===================================
a_serch.bat ==>

C:\___HMG\script.bat "c:\_order\PPP_EDIT.Prg" "IF EMPTY(cPrvID)"
======================================
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Programmers editor with...?

Post by Roberto Lopez »

Tiger wrote:How about this ... ( I got it from Google )
and it works on my PC with notepad++
Works nicely and extremely fast.

In a 35000 lines prg it found a procedure name near the last line almost instantly.

Thanks!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Programmers editor with...?

Post by bpd2000 »

I use FNR, link below to find anything
You click on result files open for editing with associated program, it search sub directory also
https://findandreplace.codeplex.com/

Image
BPD
Convert Dream into Reality through HMG
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Programmers editor with...?

Post by Roberto Lopez »

Tiger wrote:How about this ... ( I got it from Google )
and it works on my PC with notepad++
=============================
script.bat ==>

@ECHO OFF &SETLOCAL
set "LineNr="
for /f "tokens=1*delims=[]" %%a in ('^<"%~1" find /i /n "%~2"') do if not defined LineNr (
set "LineNr=%%a"
SET "Line=%%b"
)
<...>
C:\___HMG\script.bat "c:\_order\PPP_EDIT.Prg" "IF EMPTY(cPrvID)"
======================================
Trying to solve this at Harbour level (I mean, find the line number for a search string to pass it as a parameter to the editor) resulted extremely slow for large files, at least, using the unique method I know to do that:

Code: Select all

			cBuffer := MEMOREAD('very.large.file.prg')

			cSearch := 'MyProcedureName'

			nLines = MLCOUNT( cBuffer , 80 )

			FOR nCurrLine = 1 TO nLines

				cTemp := MEMOLINE( cBuffer , 80 , nCurrLine)
				
				IF cSearch $ cTemp
					MSGINFO( STR( nCurrLine ) )
					EXIT
				ENDIF

			NEXT
Is there any way to do that in Harbour faster?

TIA
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply