Function XbrHexEdit() "more" Search

Function XbrHexEdit() "more" Search

Postby Jimmy » Thu Apr 13, 2023 10:02 am

hi,

i found Function XbrHexEdit() which can show me HEX Code

as it use XBROWSE it have Codeblock bSeek

Code: Select all  Expand view
     :bSeek            := { |c,nAt| If( Empty( c ), nAt := 1, nAt := At( Upper( c ), cUpper ) ), ;
                           If( nAt > 0, oBrw:nArrayAt := Int( nAt / 16 ) + 1, nil ), ;
                           nAt > 0 } 

when press a Key it will begin "increment" search which work fine

now i want to "continue" to search "more" ... how :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1613
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Function XbrHexEdit() "more" Search

Postby Jimmy » Fri Apr 14, 2023 4:26 am

got it :D

a.) make a copy function XbrHexEdit() of which is in c:\fwh\source\classes\xbrowse.prg
b.) add
Code: Select all  Expand view
   oBrw:bKeyDown := { | nKey, nFlag | DoHEXKey( nKey, nFlag, oDlg, oBrw, cUpper ) }
! Note : bKeyDown here is for oBrw, not oDlg

c.) use this Function
Code: Select all  Expand view
STATIC PROCEDURE DoHEXKey( nKey, nFlag, oDlg, oBrw, cUpper )
LOCAL cSeek  := ""
LOCAL nStart := 0
LOCAL nAt

   DO CASE
      CASE nKey = VK_ESCAPE
         oDlg:End()

      CASE nKey = VK_F3
         cSeek := oBrw:cSeek
         nStart := oBrw:nArrayAt * 16
         nStart += 1

         nAt := hb_AT( UPPER( cSeek ), cUpper, nStart )
         IF nAt > 0
            oBrw:nRowSel := INT( nAt / 16 ) + 1
            oBrw:nArrayAt := INT( nAt / 16 ) + 1
            oBrw:Refresh()
         ELSE
            MsgInfo( "not found" )
         ENDIF
   ENDCASE
RETURN

you have to search 1st Item, than you can press F3 to search for "more"
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1613
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Function XbrHexEdit() "more" Search

Postby Antonio Linares » Fri Apr 14, 2023 6:55 am

Dear Jimmy,

many thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41476
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 46 guests