Page 2 of 3

Re: Programmers editor with...?

Posted: Sun Jul 31, 2016 8:04 am
by Rathinagiri
Why can't you use the functionlist feature in Notepad++? The search box can search any function name instantly.

Re: Programmers editor with...?

Posted: Sun Jul 31, 2016 11:19 am
by Roberto Lopez
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.

Re: Programmers editor with...?

Posted: Mon Aug 01, 2016 8:05 am
by PeteWG
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

Re: Programmers editor with...?

Posted: Mon Aug 01, 2016 1:49 pm
by Roberto Lopez
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.

Re: Programmers editor with...?

Posted: Wed Aug 03, 2016 12:41 am
by Roberto Lopez
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.

Re: Programmers editor with...?

Posted: Wed Aug 03, 2016 10:46 am
by PeteWG
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

Re: Programmers editor with...?

Posted: Wed Aug 03, 2016 5:01 pm
by Roberto Lopez
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.

Re: Programmers editor with...?

Posted: Wed Aug 03, 2016 6:43 pm
by PeteWG
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

Re: Programmers editor with...?

Posted: Wed Aug 03, 2016 7:35 pm
by Rathinagiri
Thanks Pete. Really a treasure to ponder!

Re: Programmers editor with...?

Posted: Wed Aug 03, 2016 10:47 pm
by Roberto Lopez
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?).