Page 1 of 1

HMGThinking-> Tuning HMG: Program Editor!

Posted: Sun Oct 16, 2016 10:59 pm
by Roberto Lopez

Re: HMGThinking-> Tuning HMG: Program Editor!

Posted: Mon Oct 17, 2016 12:13 am
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.

Re: HMGThinking-> Tuning HMG: Program Editor!

Posted: Mon Oct 17, 2016 3:26 am
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

Re: HMGThinking-> Tuning HMG: Program Editor!

Posted: Mon Oct 17, 2016 4:25 am
by Rathinagiri
Yes we shall do.

We can add Notepad++ again for the convenience. :)

HMGThinking-> Tuning HMG: Program Editor!

Posted: Wed Nov 09, 2016 6:29 pm
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 324 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 4544 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.

HMGThinking-> Tuning HMG: Program Editor!

Posted: Thu Nov 10, 2016 2:14 pm
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 4457 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...