show DELETED Record in XBROWSE

show DELETED Record in XBROWSE

Postby Jimmy » Fri May 26, 2023 3:39 am

hi,

i want to shsw DELETED Record so i use

Code: Select all  Expand view
   SET DELETED OFF
   BrowseDBF( cPath, cFile, cAlias, cRdd )
   SET DELETED ON

but when call

Code: Select all  Expand view
  oBrwDBF:Delete( .T. ) // what is Parameter .T. for ?

i got a "YesNo Box" and after "Yes" Record disappear in XBROWSE ... :?

so how configure XBROWSE to "show" DELETED Record which i can RECALL :?:

p.s. open DBF have no Index
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: show DELETED Record in XBROWSE

Postby Jimmy » Fri May 26, 2023 2:17 pm

hi,

did nobody have a Solution to "show" DELETED Record in XBROWSE :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: show DELETED Record in XBROWSE

Postby nageswaragunupudi » Fri May 26, 2023 2:44 pm

I am just starting my work.
Pls wait
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10595
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: show DELETED Record in XBROWSE

Postby nageswaragunupudi » Fri May 26, 2023 3:16 pm

what is Parameter .T. for ?


Syntax:
Code: Select all  Expand view
oBrw:Delete( [lMessage] )

If the lMessage parameter is .T., a MsgeYesNo() box is displayed and only if the user selects "Yes", the Record is deleted()
Otherwise, the record is deleted without any message.

If SET DELETED IS ON, deleted records are not displayed and after deletion, the deleted record goes out sight.
If SET DELETED IS OFF, all deleted records appear and even after deletion, the record still appears.
We confirm this behavior.

If in your case, after deletion, the record disappears, Set Deleted might be ON at that time. We request you to recheck your program.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10595
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: show DELETED Record in XBROWSE

Postby nageswaragunupudi » Fri May 26, 2023 3:28 pm

Test Program
Code: Select all  Expand view
#include "fivewin.ch"
#include "set.ch"

function Main()

   local oDlg, oBrw, oBar, oChk

   COPY FILE STATES.DBF TO STATES2.DBF

   USE STATES2 NEW SHARED VIA "DBFNTX"
   SET DELETED OFF

   DEFINE DIALOG oDlg SIZE 400,400 PIXEL TRUEPIXEL
   DEFINE BUTTONBAR oBar OF oDlg SIZE 64,64 2007

   @ 80,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE "STATES2" ;
      COLUMNS "DELETED() AS DELETED","CODE","NAME" ;
      CELL LINES NOBORDER

   WITH OBJECT oBrw
      :RecSelShowRecNo()
      :Deleted:SetCheck(,.t.)
      :bClrStd := { || { CLR_BLACK, ;
            If( ( oBrw:cAlias )->( DELETED() ), CLR_HGRAY, CLR_WHITE ) } }

      //
      :CreateFromCode()
   END

   DEFINE BUTTON OF oBar PROMPT "Delete" CENTER ACTION oBrw:Delete()
   DEFINE BUTTON OF oBar PROMPT "Recall" CENTER ;
      ACTION ( ( oBrw:cAlias )->( If( DELETED() .and. oBrw:Lock(), ;
                  DBRECALL(), nil ) ), ;
                  oBrw:Refresh() )
   DEFINE BUTTON OF oBar PROMPT "SET DELETED" CENTER ;
      ACTION (Set(_SET_DELETED,!Set(_SET_DELETED)),;
      oBar:Refresh(),oBrw:GoTop(),oBrw:Refresh() )
   oBar:bPainted  := { || oBar:SayText( "DELETED " + ;
      If( Set(_SET_DELETED), "ON", "OFF" ),{,,,-30}, "R",,CLR_HRED ) }

   ACTIVATE DIALOG oDlg CENTERED

return nil


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10595
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: show DELETED Record in XBROWSE

Postby Jimmy » Fri May 26, 2023 4:40 pm

hi,

you Sample work

i saw these Line
Code: Select all  Expand view
   COLUMNS "DELETED() AS DELETED","CODE","NAME" ;

   :RecSelShowRecNo()
   :Deleted:SetCheck(,.t.)

Sample need COLUMNS "DELETED() AS DELETED" ... but i don´t know Column as i don´t have "fix" DBF

i do use
Code: Select all  Expand view
  COLUMNS ColsNumber( DBSTRUCT() ) ;

hm ... can i build a String of COLUMNS before create XBROWSE, will that work :?:

--

i have add Msginfo(() before ACTIVATE

Code: Select all  Expand view
  Msginfo(" DETELED IS " + If( Set(_SET_DELETED), "ON", "OFF" ) )

   ACTIVATE WINDOW oWnd ;
 

just to be sure that DELETED if OFF

but still i do not seen any DELETED Record in XBROWSE ... :(

Code: Select all  Expand view
     @ nBhight,  2 XBROWSE oBrwDBF SIZE nWidth - 20, nHeight - 90 PIXEL OF oWnd ;
              DATASOURCE cAlias ;                 // ALIAS cAlias
              COLUMNS ColsNumber( DBSTRUCT() ) ;
              FONT oFontDefault ;
              COLOR BFcolor, BGcolor ;
              CELL LINES NOBORDER FASTEDIT AUTOCOLS AUTOSORT

      oBrwDBF:nStretchCol := STRETCHCOL_WIDEST

      oBrwDBF:lRecordSelector := .F.
      oBrwDBF:bChange := { || SayStatusDBF( oBrwDBF, oGet, @nVar ) }
      oBrwDBF:bOnSort := { || oBrwDBF:Refresh() }

      // oBrwDBF:bClrEdit     := { || { BFcolor, BGcolor } }
      oBrwDBF:bClrStd := { || { BFcolor, BGcolor } }
      // oBrwDBF:bClrSel      := { || { BFcolor, BGcolor } }
      oBrwDBF:bClrHeader := { || { BFcolor, BGcolor } }
      // oBrwDBF:bClrFooter   := { || { BFcolor, BGcolor } }
      // oBrwDBF:bClrSelFocus := { || { CLR_WHITE, GetSysColor( COLOR_MENUHILIGHT ) } }
      oBrwDBF:bClrGrad := bGradient

      // edit CELL
      // oBrwDBF:nEditTypes := EDIT_GET
      // override F2 CELL edit
      // oBrwDBF:lF2KeyToEdit := .T.

      * oBrwDBF:RecSelShowRecNo()
      * oBrwDBF:Deleted:SetCheck(,.t.) // COLUMNS "DELETED() AS DELETED",

      oBrwDBF:CreateFromCode()
 

what i´m doing wrong that DELETED Record are not show in XBROWSE

will try to make Sample
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: show DELETED Record in XBROWSE

Postby Jimmy » Fri May 26, 2023 11:33 pm

hi,

found a Solution for "me" , but not able to make a Sample

in my MAIN i have
Code: Select all  Expand view
   SET DELETED ON

i have try this
Code: Select all  Expand view
  USE (cDBF)
   SET DELETED OFF

so it was AFTER open DBF ...
this make the funny Effect that MsgInfo say "OFF" but DBF "react" like "ON"

now when change to
Code: Select all  Expand view
  SET DELETED OFF
   USE (cDBF)

it work :)

but as i say i can´t reproduce it in a small Sample
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: show DELETED Record in XBROWSE

Postby nageswaragunupudi » Sat May 27, 2023 9:40 am

Whatever happens to your end, you should be able to reproduce with a sample.
Like whatever we said, we proved with a sample.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10595
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: show DELETED Record in XBROWSE

Postby nageswaragunupudi » Sat May 27, 2023 9:40 am

Whatever happens to your end, you should be able to reproduce with a sample.
Like whatever we said, we proved with a sample.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10595
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: show DELETED Record in XBROWSE

Postby nageswaragunupudi » Sun May 28, 2023 2:32 am

If you can please clarify my doubt, I am interested in knowing this:

In case of Clipper/Harbour, SET DELETED OFF/ON is a Global (application wide) setting, whereas in case of Dbase/FoxPro, this setting is a workarea wise setting.

That means, in this code:
Code: Select all  Expand view

SELECT 1
SET DELETED OFF
SELECT 2
SET DELETED ON
SELECT 1
// now whatis the status?
// In Clipper/Harbour, it is ON
// In DBase/FoxPrro is OFF
// In Xbase++ ???
 

Can you kindly clarify if XBase++ is compatible with Dbase/FoxPro behavior or Clipper/Harbour behavior?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10595
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: show DELETED Record in XBROWSE

Postby Jimmy » Sun May 28, 2023 4:43 am

hi,

Xbase++ SET DELETED OFF/ON are Global (application wide) setting, even in Thread which have a other "Workspacelist"

i can send you hole Project as i´mm not able (yet) to build a Sample which same Effect.
it doesn´t matter in "this" Project as DUALGRID but for other Project i have to find out what is going on
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: show DELETED Record in XBROWSE

Postby nageswaragunupudi » Sun May 28, 2023 6:35 am

Yes, please.
Though I am not sure if can understand.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10595
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 27 guests