HMGThinking-> Tuning HMG: Program Editor!

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

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

HMGThinking-> Tuning HMG: Program Editor!

Post by Roberto Lopez »

Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: HMGThinking-> Tuning HMG: Program Editor!

Post by srvet_claudio »

HMGThinking is a web page with very interesting reflections, we could have here in the forum a section where links are grouped to this external pages.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: HMGThinking-> Tuning HMG: Program Editor!

Post by bpd2000 »

srvet_claudio wrote:HMGThinking is a web page with very interesting reflections, we could have here in the forum a section where links are grouped to this external pages.
+1
BPD
Convert Dream into Reality through HMG
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMGThinking-> Tuning HMG: Program Editor!

Post by Rathinagiri »

Yes we shall do.

We can add Notepad++ again for the convenience. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

HMGThinking-> Tuning HMG: Program Editor!

Post by Pablo César »

Hi Rathi,

I've just installed in my own new PC and prepared a installed package with:

- Localization (most common human language)
- Plugins: PluginManager, FunctionList, AutoCompletion (with syntax of most xBase functions), QuickText, CLRTabsToSpaces
- Code Language (but this attached xBase.xls is updated): xBase (attention for whom does not knows: HMG, Harbour, Clipper are programming tools, not code language)

All are workable in this package (2,93 MB file size).
Notepad++.rar
Notepad++ version 7.2 pack
(2.93 MiB) Downloaded 321 times
The users can select in HMG/IDE which want to work in Tools/Preference/Module Editor.

I do not know what the opinion of others is. I am without wanting to cause controversy or to set aside, just my opinion:
We're going back to add Notepad++ to the HMG package, since most have their source code editor installed on their PCs.
But on the other hand, I've always enjoyed the convenience that the HMG package offers over Harbour, MiniGW, IDE.

Hi Claudio,

When we have not any source editor installed yet in PC or when we just installed but not rebooted yet and we go to Tools/Preference/Module Editor it's coming this wrongly path (pls see picture below):
Screen1.png
Screen1.png (8.31 KiB) Viewed 4444 times
Most probably IDE function do not found in Windows register the .prg associated.

In case you are interested to see how I detect, I'm attaching a demo for your appreciation.

Code: Select all

#include <hmg.ch>

Function Main
Local cEditor:=CheckExt("prg") // HKEY_CLASSES_ROOT\.PRG
Local cNPP:=""

If Empty(cEditor)
   cNPP:=IsNotepadPlusPlus()
   If !Empty(cNPP)
      If MsgYesNo("Do you want to set Notepad++ as source default editor ?","Notepad++ is already installed")
	     cEditor:=cNPP
	  Endif
   Endif
Endif
If Empty(cEditor)
   MsgStop("Source editor <Not installed> !")
Else
   MsgInfo(cEditor,"Editor for prg files")
Endif
Return Nil

Function CheckExt(cExt)
Local cRet, nIni, nFin

cRet := RegistryRead("HKEY_CLASSES_ROOT\."+cExt+"\")
If cRet=Nil
   cRet:=""
Else
   If !(":\" $ cRet)
      cRet := RegistryRead("HKEY_CLASSES_ROOT\"+cRet+"\shell\open\command\")
   Endif
Endif
If ":\" $ cRet
   nIni:=HB_UAt('"',cRet)
   nFin:=HB_UAt('"',HB_USubStr(cRet,nIni+1),2)
   cRet:=HB_USubStr(cRet,nIni+1,nFin-1)
   If !File(cRet)
	   cRet:=""
   Endif
Endif
Return cRet

Function IsNotepadPlusPlus()
Local cRet:=""

cRet := RegistryRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Notepad++\UninstallString")
If !Empty(cRet)
   If File(cRet)
      cRet:=HB_USubStr(cRet,1,HB_UAt("\UNINSTALL.EXE",HMG_Upper(cRet)))+"notepad++.exe"
	  If !File(cRet)
	     cRet:=""
	  Endif
   Else
      cRet:=""
   Endif
Endif
Return cRet
Added later:

This example doesn't sets anything at current Windows Register. So, it's totally for info and IDE setup that proposes only.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

HMGThinking-> Tuning HMG: Program Editor!

Post by Pablo César »

Sharing experience and more info about this matter...

I surely prefer to have my Notepad++ installed not like as:
NPP1.png
NPP1.png (36.37 KiB) Viewed 4357 times
Because this way installed it's for USB proposes and do not save all the prgs that were open Notepad exiting program.

I prefer to keep all open files recorded in its own Notepad capacities not to cut resources...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply