Programmers editor with...?

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

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5210
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 155 times
Been thanked: 144 times
Contact:

Re: Programmers editor with...?

Post by Rathinagiri » Sun Jul 31, 2016 8:04 am

Why can't you use the functionlist feature in Notepad++? The search box can search any function name instantly.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Roberto Lopez
HMG Founder
Posts: 3905
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Sun Jul 31, 2016 11:19 am

Rathinagiri wrote:Why can't you use the functionlist feature in Notepad++? The search box can search any function name instantly.
I want to open notepad++ positioned exactly at a specific procedure name, without needing to do a manual search operation.

This is perfectly done using the batch file posted by Tiger.

I'm simply exploring the possibility to get the line number for a search expression at Harbour level to avoid the batch file.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
PeteWG
Posts: 112
Joined: Sun Mar 21, 2010 5:45 pm
Has thanked: 4 times
Been thanked: 34 times

Post by PeteWG » Mon Aug 01, 2016 8:05 am

Roberto Lopez wrote: Is there any way to do that in Harbour faster?
TIA
Well, it depends on your definition of "faster" ;-)
Please try the code below to see if it's fast enough, for your needs.

Code: Select all

PROCEDURE Main()
   
   LOCAL cSearchFor := "2009-02-14 13:25 UTC+0100"
   LOCAL aLines := hb_ATokens( MemoRead( "C:\Harbour\ChangeLog.txt" ), .T. )
   
   ? Len( aLines )
   
    // CASE SENSITIVE 
   AEVal( aLines, {|e,n| Iif( cSearchFor $ e, hb_Alert( cSearchFor + " found in line: "+hb_ntos( n ) ), NIL )} )
   
   // CASE INSENSITIVE 
   // AEVal( aLines, {|e,n| Iif( hb_AtI( cSearchFor, e) > 0, hb_Alert( cSearchFor + " found in line: " + hb_ntos( n ) ), NIL )} )
   
   wait

   RETURN
I suppose that harbour's <Changelog.txt> is a decently large file. Don't know if your .prg exceeds that size!
regards,

---
Pete

User avatar
Roberto Lopez
HMG Founder
Posts: 3905
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Mon Aug 01, 2016 1:49 pm

PeteWG wrote:
Roberto Lopez wrote: Is there any way to do that in Harbour faster?
TIA
Well, it depends on your definition of "faster" ;-)
Please try the code below to see if it's fast enough, for your needs.
<...>
I suppose that harbour's <Changelog.txt> is a decently large file. Don't know if your .prg exceeds that size!
regards,

---
Pete
Some of my sources are very large (around 2mb size) but significally smaller than Chengelog... so... it should work...

Thanks!... I'll try it.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3905
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Wed Aug 03, 2016 12:41 am

Pete,

It works amazingly fast. I'm using it to search for a procedure name inside about 600 prg files (6 MB of source code) and it is nearly instantaneous.

Since I need the line number, I've used chr(13) as delimiter in hb_ATokens().

Thanks again.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
PeteWG
Posts: 112
Joined: Sun Mar 21, 2010 5:45 pm
Has thanked: 4 times
Been thanked: 34 times

Post by PeteWG » Wed Aug 03, 2016 10:46 am

Roberto Lopez wrote:Pete,
It works amazingly fast. I'm using it to search for a procedure name inside about 600 prg files (6 MB of source code) and it is nearly instantaneous.
Since I need the line number, I've used chr(13) as delimiter in hb_ATokens().
Glad to see it worked for you!
No surprise about speed.
Harbour is indeed amazingly fast for its genre (p-code languages/compilers),
just taking a closer look into the plethora of functions (particularly the hb_* family),
is usually enough to reveal all the tremendous power it offers the users.
Roberto Lopez wrote:Thanks again.
rather I myself should say thanks to you for "inventing" minigui! ;-)

regards,

---
Pete

User avatar
Roberto Lopez
HMG Founder
Posts: 3905
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Wed Aug 03, 2016 5:01 pm

PeteWG wrote: <...>
Harbour is indeed amazingly fast for its genre (p-code languages/compilers),
just taking a closer look into the plethora of functions (particularly the hb_* family),
is usually enough to reveal all the tremendous power it offers the users.
<...>
Yes, but, sadly, those functions, are not fully docummented and there is no so much usage examples... the only way to go, is to dig on the changelog and Harbour sources...

Some of tthese functions certainly deserves a wrapper with a more friendly name and basic code samples.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
PeteWG
Posts: 112
Joined: Sun Mar 21, 2010 5:45 pm
Has thanked: 4 times
Been thanked: 34 times

Post by PeteWG » Wed Aug 03, 2016 6:43 pm

Roberto Lopez wrote: Yes, but, sadly, those functions, are not fully docummented and there is no so much usage examples... the only way to go, is to dig on the changelog and Harbour sources...
Oh yes, documentation! an everlasting request (and a constant chance for whining :-) ) of all Harbour users.
I'd say that the documentation (or rather the lack of it) it's the Achilles' heel of nearly any open source software.
I was struggling with this problem from when I started using harbour.
However, seems that things have somehow improved in this field.
Some very knowledgeable guys out there, have created some quite good pieces of Harbour documentation.
And then, some time ago, I thought to gather all those good docs that I had found and create a wiki
at GitHub (initially motivated from an original idea by Juan Gamero).
Basically, it's a kind of a "dictionary" (or try to be, anyway ;-)) of Harbour functions with a short description and syntax.
Since it is a work on progress, it certainly is not complete, but I can say it somehow helps as reference.

In the hope it might be useful for you or anyone interested, here is the the link.
And if you'll be there, don't miss to take a look at references, for links of sites with valuable docs.

regards,

---
Pete

User avatar
Rathinagiri
Posts: 5210
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 155 times
Been thanked: 144 times
Contact:

Post by Rathinagiri » Wed Aug 03, 2016 7:35 pm

Thanks Pete. Really a treasure to ponder!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Roberto Lopez
HMG Founder
Posts: 3905
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Wed Aug 03, 2016 10:47 pm

PeteWG wrote: <...>
In the hope it might be useful for you or anyone interested, here is the the link.
And if you'll be there, don't miss to take a look at references, for links of sites with valuable docs.
There is some 'jewels' there, like:

Code: Select all

hb_ADel(<aArray> [, <nPos>, <lAutoSize>]) 
AutoSize when you deleting array items is like a dream!.

Thanks!... This is wonderful.. maybe this links should be added to HMG reference (Claudio, Rathi... what do you think?).
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

Post Reply