It is currently Thu May 28, 2020 3:32 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Code Explorer [jaPBe plugin]
PostPosted: Mon Jun 28, 2004 8:13 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
Code Explorer (jaPBe standalone plugin) Last update : SEPT 10th 2008

Description :
Code Explorer is an enhanced version of the PBI's Code Templates plugin for jaPBe.
I use it to view / find code templates in my purebasic code archives (some are
zipped).

Major changes (new features) :
Code:
- ZIP archive support in file explorer panel.
- new search panel to find text in files (ZIP archive supported) with favorite
  directories and search history support.
- syntax highlighting (not so fast that I hoped, so it can be disabled).
- find text function.
- added compile/run (jaPBe plugin).
- added Win32 help in viewer context-menu (search for selected text)
  (the file win32.hlp must be located in %PUREBASIC%\HELP).
Minor changes :
- it can be used as a jaPBe plugin (Options\'Register jaPBe Plugin' button)
  or not : just run CodeExplorer.exe from any directory. You will have all
  the features minus the jaPBe copy/insert functions.
- files list is now sorted.
- right-click context menu in viewer (if used as a jaPBe plugin).
- the jaPBe functions now work with >64 text (using pointers and not strings).
- code loading through RichEdit stream callback (faster).


Download :
http://gnozal.ucoz.com/CodeExplorer.zip


Last edited by gnozal on Wed Sep 10, 2008 12:55 pm, edited 7 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Apr 20, 2005 8:08 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
Update
Fixed some installation problems

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue May 10, 2005 7:58 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
Update
Fixed CopyToJaPBe function

This message was lost during the forum crash

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jul 31, 2005 4:17 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Jan 07, 2005 7:17 pm
Posts: 119
Could you explain 2 options in Options tab:
"Load keywords from PureBasic.exe"
"Start PBCompiler if necessary"

Thanks in advance:
Jan2004


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Aug 01, 2005 8:14 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
Jan2004 wrote:
Could you explain 2 options in Options tab:
"Load keywords from PureBasic.exe"
"Start PBCompiler if necessary"


Quote:
"Load keywords from PureBasic.exe"

Search for purebasic keywords in the Purebasic.exe (editor) for the syntax highlighting.
Quote:
"Start PBCompiler if necessary"

The functions names (for the syntax highlighting) are loaded from file PBFunctionListing.txt created by the compiler. If this file does not exist and the option is checked, CoodeExplorer will launch the compiler to create the file.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Aug 01, 2005 9:59 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Jan 07, 2005 7:17 pm
Posts: 119
All clear.
Thanks again.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Oct 14, 2005 7:50 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
Update

Changes
- Updated keywords extraction code (compatible with the new editor)

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Oct 21, 2005 6:57 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat May 17, 2003 11:31 am
Posts: 6073
gnozal, i would like to know how you did the update keywords thingy exactly, would you be willing to share the info / code?

_________________
( PB5.xx Win10 x64 Asrock AB350 Pro4 Ryzen 1600X 32GB RAM Evo 840 GTX1060 )
( The path to enlightenment and the PureBasic Survival Guide right here... )


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Oct 22, 2005 8:03 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
blueznl wrote:
gnozal, i would like to know how you did the update keywords thingy exactly, would you be willing to share the info / code?

I don't have the CodeExplorer code at hand right now, but here is the code from PureSynPlus http://forums.purebasic.com/english/vie ... hp?t=14343 wich should be the same (old code, not very clean, it has been updated many times to match with every new PB Editor version, but seems to work).
Code:
Procedure.l ExtractPBFunctions()
  Protected FunctionsFile.s, Stream.l
  FunctionsFile =  GetPBFolder() + "Compilers\PBFunctionListing.txt"
  If FileSize(FunctionsFile) < 1
    ; Call PBCompiler to create the file
    #PB_MSG_Compiler_Ready = 10157
    PB_MSG_ID = RegisterWindowMessage_("PB_MSG_ID")
    PBCompiler.s = GetPBFolder() + "Compilers\PBCompiler.exe"
    Parameters.s = Str(GetCurrentThreadId_()) + " /STANDBY"
    CompilerProcessID = RunProgram(PBCompiler, Parameters, "", 2)
    If CompilerProcessID
      Repeat
        Event = WindowEvent()
        If Event = PB_MSG_ID
          If EventwParam() = #PB_MSG_Compiler_Ready
            CompilerThreadID = EventlParam()
            TerminateProcess_(CompilerProcessID,0)
            Break
          EndIf
        EndIf
      ForEver
    EndIf
  EndIf
  Stream = ReadFile(#PB_Any, FunctionsFile)
  If Stream
    ; Load functions
    NbBasicFunctions = Val(ReadString())
    If NbBasicFunctions < 60000 And NbBasicFunctions > 0
      ClearList(PurebasicFunctions())
      ; Charger fonctions
      CurrentFunction = 1
      *MotsClefs_Fonctions_AllocMem = GlobalAlloc_(#GMEM_FIXED | #GMEM_ZEROINIT, Lof() + 2)
      *ProgressionMem.BYTE = *MotsClefs_Fonctions_AllocMem
      If *ProgressionMem
        ReadData(*ProgressionMem, Lof())
        Repeat
          OldProgressionMem = *ProgressionMem
          Repeat
            *ProgressionMem = *ProgressionMem + 1
          Until *ProgressionMem\b = 32 Or *ProgressionMem\b = 10 Or *ProgressionMem\b = 0
          If *ProgressionMem\b = 32
            *ProgressionMem\b = 0
            AddElement(PurebasicFunctions())
            PurebasicFunctions()= PeekS(OldProgressionMem)
            Repeat
              *ProgressionMem = *ProgressionMem + 1
            Until *ProgressionMem\b = 10 Or *ProgressionMem\b = 0
          ElseIf *ProgressionMem\b = 10
            *ProgressionMem\b = 0
            AddElement(PurebasicFunctions())
            PurebasicFunctions()= PeekS(OldProgressionMem)
          Else
            Break
          EndIf
          *ProgressionMem = *ProgressionMem + 1
        Until CurrentFunction > NbBasicFunctions Or *ProgressionMem\b = 0
        GlobalFree_(*MotsClefs_Fonctions_AllocMem)
      EndIf
    EndIf
    CloseFile(Stream)
  EndIf
  ProcedureReturn CountList(PurebasicFunctions())
EndProcedure
;
Procedure.l ExtractPBKeywords()
  Protected PurebasicEXEFile.s, Stream.l
  PurebasicEXEFile = GetPBFolder() + "purebasic.exe"
  TailleFichier.l = FileSize(PurebasicEXEFile)
  If TailleFichier > 4
    Stream = ReadFile(#PB_Any, PurebasicEXEFile)
    If Stream
      ClearList(PurebasicKeywords())
      *MotsClefs_Fonctions_AllocMem = GlobalAlloc_(#GMEM_FIXED | #GMEM_ZEROINIT, Lof() + 2)
      *ProgressionMem1.LONG = *MotsClefs_Fonctions_AllocMem
      FinProgressionMem = *ProgressionMem1 + Lof()
      If *ProgressionMem1
        ReadData(*ProgressionMem1, Lof())
        ; Recherche début
        Repeat
          If *ProgressionMem1\l = $00646E41 ; '<Nul>dnA'
            *ProgressionMem1 = *ProgressionMem1 + 4
            If *ProgressionMem1\l = $00646E61 ; '<Nul>dna'
              *ProgressionMem2.BYTE = *ProgressionMem1 - 5
              Debug "found : " + Str(*ProgressionMem1 - 4 - *MotsClefs_Fonctions_AllocMem)
              Break
            EndIf
          EndIf
          *ProgressionMem1 = *ProgressionMem1 + 1
        Until *ProgressionMem1 = FinProgressionMem
        ; Extraction des mots clés
        If *ProgressionMem2
          MotClef.s = ""
          MotClefToggle.l = 1
          LastMotClef.l = -1
          Repeat
            *ProgressionMem2 = *ProgressionMem2 + 1
            If *ProgressionMem2\b = 0 And LastMotClef <> 0
              MotClef = Trim(MotClef)
              If UCase(MotClef) =  "AAA"
                ; on s'arrête aux mot clés ASM [en majuscules]
                Break
              EndIf
              If MotClef
                If CountList(PurebasicKeywords())
                  ExisteDeja = #FALSE
                  ForEach PurebasicKeywords()
                    If UCase(PurebasicKeywords()) = UCase(MotClef)
                      ExisteDeja = #TRUE
                      Break
                    EndIf
                  Next
                  If ExisteDeja = #FALSE
                    AddElement(PurebasicKeywords())
                    PurebasicKeywords()= MotClef
                    Debug MotClef
                  EndIf
                Else
                  AddElement(PurebasicKeywords())
                  PurebasicKeywords()= MotClef
                  Debug MotClef
                EndIf
                MotClef = ""
              EndIf
            ElseIf (*ProgressionMem2\b > 96 And *ProgressionMem2\b < 123) Or (*ProgressionMem2\b > 64 And *ProgressionMem2\b < 91)
              MotClef = MotClef + Chr(*ProgressionMem2\b)
            EndIf
            LastMotClef = *ProgressionMem2\b
          Until *ProgressionMem2 = FinProgressionMem
        EndIf
        GlobalFree_(*MotsClefs_Fonctions_AllocMem)
      EndIf
      CloseFile(Stream)
    EndIf
  EndIf
  ProcedureReturn CountList(PurebasicKeywords())
EndProcedure

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Dec 02, 2006 1:38 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Jan 12, 2004 11:40 pm
Posts: 761
Location: Okazaki, JAPAN
Launch Error
No drive E: !

My Drive Setting
A: Floppy
C: & D: SD&CF Memory slot
E: DVD-RW
F: Windows
G: External HDD

<ADD&Solved)
Special Directry Remove Example
Restart

_________________
My homepage in Japan - Bug head Nontallion
My facebook page.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Sep 08, 2007 10:34 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
Update

- added PB4.1x support

I mostly use PureTemplate now : http://www.purebasic.fr/english/viewtopic.php?t=28477

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 10, 2007 7:33 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
Update (build 12)

Changes :
- updated PB folder detection for PB4.10 beta 4
- fixed crash with Vista

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Apr 15, 2008 1:44 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
Update

Changes :
- update for PB4.20 beta

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject: Problems with CodeExplorer
PostPosted: Thu Jun 19, 2008 11:26 am 
Offline
New User
New User
User avatar

Joined: Wed Oct 31, 2007 10:59 am
Posts: 4
Location: Sweden
Running CodeExplorer from any directory (even from within the IDE) gives error message: "Purebasic not found".

Regards
mjw


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jun 24, 2008 5:20 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
CodeExplorer uses this code to get the PB directory :
Code:
Procedure.s GetPBFolder() ; Retrieves Purebasic folder [empty string if not installed]
  Protected hKey1.l, Type.l, Res.l, Folder$, lpbData.l, cbData.l, WindowsVersion.l
  cbData = (#MAX_PATH * 2) + 2
  lpbData = AllocateMemory(cbData)
  Folder$=""
  hKey1=0
  Type=0
  Res=-1
  WindowsVersion = OSVersion()
  If WindowsVersion = #PB_OS_Windows_95 Or WindowsVersion = #PB_OS_Windows_98 Or WindowsVersion = #PB_OS_Windows_ME
    Debug "Detected OS : Windows 95/98/ME"
    Res=RegOpenKeyEx_(#HKEY_LOCAL_MACHINE, "Software\Classes\PureBasic.exe\shell\open\command", 0, #KEY_ALL_ACCESS, @hKey1)
  ElseIf WindowsVersion = #PB_OS_Windows_NT3_51 Or WindowsVersion = #PB_OS_Windows_NT_4 Or WindowsVersion = #PB_OS_Windows_2000 Or WindowsVersion = #PB_OS_Windows_XP Or WindowsVersion = #PB_OS_Windows_Server_2003
    Debug "Detected OS : Windows NT/2000/XP"
    Res=RegOpenKeyEx_(#HKEY_CLASSES_ROOT, "Applications\PureBasic.exe\shell\open\command", 0, #KEY_ALL_ACCESS, @hKey1)
  Else
    Debug "Detected OS : Windows Vista/Server 2008"
    Res=RegOpenKeyEx_(#HKEY_CURRENT_USER, "Software\Classes\PureBasic.exe\shell\open\command", 0, #KEY_ALL_ACCESS , @hKey1)
  EndIf
  If Res = #ERROR_SUCCESS And hKey1
    If RegQueryValueEx_(hKey1, "", 0, @Type, lpbData, @cbData)=#ERROR_SUCCESS
      Folder$ = PeekS(lpbData)
      Folder$ = GetPathPart(StringField(Folder$,2,Chr(34)))
    EndIf
    RegCloseKey_(hKey1)
  EndIf
  If lpbData
    FreeMemory(lpbData)
    lpbData=0
  EndIf
  ProcedureReturn Folder$
EndProcedure
Does it work for you ?
The PB registry keys are changing with every version lately ...

<EDIT>
Update : updated PB folder detection code

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye