Listbox displays incorrect data
- cdmmaui
- Posts: 693
- Joined: Fri Oct 28, 2005 9:53 am
- Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong
- Contact:
Listbox displays incorrect data
Hello Everyone,
We have a problem with a specific LISTBOX. For some reason, the listbox is displaying incorrect details, specifically when no key is found. The associated DBF has an index related to the specific key. What would cause this problem?
I have checked the DBF for corruption and I have deleted the index and rebuilt
//
//
// Source
DEFINE DIALOG oDlgEvent RESOURCE "EVENT" TITLE cEtitle
REDEFINE COMBOBOX aGet[01] VAR cEvent ID 101 ITEMS aEvent OF oDlgEvent
REDEFINE GET aGet[02] VAR dDate ID 102 OF oDlgEvent PICTURE "@D"
REDEFINE GET aGet[03] VAR cTime ID 103 OF oDlgEvent PICTURE "99:99"
REDEFINE GET aGet[04] VAR cBy ID 104 OF oDlgEvent PICTURE "@!"
REDEFINE GET aGet[05] VAR cNotes ID 105 MEMO OF oDlgEvent
REDEFINE CHECKBOX aGet[06] VAR lCts ID 106 OF oDlgEvent
REDEFINE CHECKBOX aGet[07] VAR lEmship ID 107 OF oDlgEvent ;
VALID( _GetRef( aGet ), .T. )
REDEFINE GET aGet[08] VAR cShipem ID 108 OF oDlgEvent WHEN lEmship
REDEFINE CHECKBOX aGet[09] VAR lEmcons ID 109 OF oDlgEvent ;
VALID( _GetRef( aGet ), .T. )
REDEFINE GET aGet[10] VAR cConsem ID 110 OF oDlgEvent WHEN lEmcons
REDEFINE CHECKBOX aGet[11] VAR lEmothr ID 111 OF oDlgEvent ;
VALID( _GetRef( aGet ), .T. )
REDEFINE GET aGet[12] VAR cOthrem ID 112 OF oDlgEvent WHEN lEmothr
// Event...
SELECT event
SET ORDER TO TAG S3
GO TOP
SEEK cFileNumber
REDEFINE LISTBOX oLbx2 FIELDS _EventDescription( event->event, aEvent ) , ;
ALLTRIM( event->notes ) , ;
DTOC(event->date) , ;
event->time , ;
event->by , ;
event->file ;
ID 6000 ;
HEADERS "Event", "Location/Notes", "Date", "Time", "By", "." ;
FIELDSIZES 350 , 350 , 85 , 50 , 200 , 99 ;
SELECT file FOR cFileNumber ;
ON DBLCLICK _EventDet() ;
OF oDlgEvent
REDEFINE BUTTON ID 202 OF oDlgEvent ACTION ( _EventUpd( @nRecId, @aEvent, @cEvent, @dDate, @cTime, @cBy, @cNotes, @lCts, @lEmShip, @cShipEm, @lEmCons, @cConsEm, @lEmothr, @cOthrEm ), _GetRef( aGet ), Sysrefresh() )
REDEFINE BUTTON ID 203 OF oDlgEvent ACTION _EventDel( oLbx2, cFileNumber ) WHEN lAdmin
REDEFINE BUTTON ID 200 OF oDlgEvent ACTION ( lUpd := .T., oDlgEvent:End() ) WHEN ( ! LEFT( cEvent, 1 ) $ "-" ) .AND. ( ! EMPTY( dDate ) ) .AND. ( ! EMPTY( LEFT(cTime,2) ) )
REDEFINE BUTTON ID 201 OF oDlgEvent ACTION ( lUpd := .F., oDlgEvent:End() )
ACTIVATE DIALOG oDlgEvent CENTERED VALID _EventOk( @lUpd, cEvent, dDate, cTime, cBy )
//
//
// Source RC compiled with Pelles C
EVENT DIALOG DISCARDABLE 49, 49, 600, 350
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION
CAPTION "Event Manager"
FONT 10, "tahoma"
{
CONTROL "Event.........................", -1, "Static", WS_GROUP, 5, 7, 75, 8
CONTROL "", 101, "ComboBox", WS_BORDER|CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP, 85, 5, 345, 300
CONTROL "Event Date.................", -1, "Static", WS_GROUP, 5, 21, 75, 8
CONTROL "", 102, "Edit", ES_AUTOHSCROLL|ES_WANTRETURN|ES_UPPERCASE|WS_BORDER|WS_TABSTOP, 85, 20, 45, 12
CONTROL "Event Time................", -1, "Static", WS_GROUP, 5, 36, 75, 8
CONTROL "", 103, "Edit", ES_AUTOHSCROLL|ES_WANTRETURN|ES_UPPERCASE|WS_BORDER|WS_TABSTOP, 85, 35, 45, 12
CONTROL "Event Name...............", -1, "Static", WS_GROUP, 5, 51, 75, 8
CONTROL "", 104, "Edit", ES_AUTOHSCROLL|ES_WANTRETURN|ES_UPPERCASE|WS_BORDER|WS_TABSTOP, 85, 50, 150, 12
CONTROL "Event Notes................", -1, "Static", WS_GROUP, 5, 66, 75, 8
CONTROL "", 105, "Edit", ES_MULTILINE|ES_AUTOVSCROLL|ES_WANTRETURN|ES_UPPERCASE|WS_BORDER|WS_TABSTOP, 85, 65, 345, 30
CONTROL "Display on Cargo Tracking System (CTS)", 106, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 5, 100, 149, 12
CONTROL "E-Mail Shipper", 107, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 5, 115, 60, 12
CONTROL "", 108, "Edit", WS_BORDER|WS_TABSTOP, 85, 115, 345, 12
CONTROL "E-Mail Consignee", 109, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 5, 130, 72, 12
CONTROL "", 110, "Edit", WS_BORDER|WS_TABSTOP, 85, 130, 345, 12
CONTROL "E-Mail Other Party", 111, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 5, 145, 77, 12
CONTROL "", 112, "Edit", WS_BORDER|WS_TABSTOP, 85, 145, 345, 12
CONTROL "OK", 200, "Button", WS_TABSTOP, 540, 5, 50, 14
CONTROL "Cancel", 201, "Button", WS_TABSTOP, 540, 24, 50, 14
CONTROL "Double Click Event below to view details", -1, "Static", SS_CENTER|WS_GROUP, 216, 160, 167, 8
CONTROL "", 6000, "TWBrowse", WS_TABSTOP|0x00b00000, 5, 170, 590, 150
CONTROL "Edit Event", 202, "Button", WS_TABSTOP, 191, 327, 100, 14
CONTROL "Remove Event", 203, "Button", WS_TABSTOP, 309, 327, 100, 14
CONTROL "Military Time", -1, "Static", SS_CENTER|WS_GROUP, 135, 36, 47, 8
}
We have a problem with a specific LISTBOX. For some reason, the listbox is displaying incorrect details, specifically when no key is found. The associated DBF has an index related to the specific key. What would cause this problem?
I have checked the DBF for corruption and I have deleted the index and rebuilt
//
//
// Source
DEFINE DIALOG oDlgEvent RESOURCE "EVENT" TITLE cEtitle
REDEFINE COMBOBOX aGet[01] VAR cEvent ID 101 ITEMS aEvent OF oDlgEvent
REDEFINE GET aGet[02] VAR dDate ID 102 OF oDlgEvent PICTURE "@D"
REDEFINE GET aGet[03] VAR cTime ID 103 OF oDlgEvent PICTURE "99:99"
REDEFINE GET aGet[04] VAR cBy ID 104 OF oDlgEvent PICTURE "@!"
REDEFINE GET aGet[05] VAR cNotes ID 105 MEMO OF oDlgEvent
REDEFINE CHECKBOX aGet[06] VAR lCts ID 106 OF oDlgEvent
REDEFINE CHECKBOX aGet[07] VAR lEmship ID 107 OF oDlgEvent ;
VALID( _GetRef( aGet ), .T. )
REDEFINE GET aGet[08] VAR cShipem ID 108 OF oDlgEvent WHEN lEmship
REDEFINE CHECKBOX aGet[09] VAR lEmcons ID 109 OF oDlgEvent ;
VALID( _GetRef( aGet ), .T. )
REDEFINE GET aGet[10] VAR cConsem ID 110 OF oDlgEvent WHEN lEmcons
REDEFINE CHECKBOX aGet[11] VAR lEmothr ID 111 OF oDlgEvent ;
VALID( _GetRef( aGet ), .T. )
REDEFINE GET aGet[12] VAR cOthrem ID 112 OF oDlgEvent WHEN lEmothr
// Event...
SELECT event
SET ORDER TO TAG S3
GO TOP
SEEK cFileNumber
REDEFINE LISTBOX oLbx2 FIELDS _EventDescription( event->event, aEvent ) , ;
ALLTRIM( event->notes ) , ;
DTOC(event->date) , ;
event->time , ;
event->by , ;
event->file ;
ID 6000 ;
HEADERS "Event", "Location/Notes", "Date", "Time", "By", "." ;
FIELDSIZES 350 , 350 , 85 , 50 , 200 , 99 ;
SELECT file FOR cFileNumber ;
ON DBLCLICK _EventDet() ;
OF oDlgEvent
REDEFINE BUTTON ID 202 OF oDlgEvent ACTION ( _EventUpd( @nRecId, @aEvent, @cEvent, @dDate, @cTime, @cBy, @cNotes, @lCts, @lEmShip, @cShipEm, @lEmCons, @cConsEm, @lEmothr, @cOthrEm ), _GetRef( aGet ), Sysrefresh() )
REDEFINE BUTTON ID 203 OF oDlgEvent ACTION _EventDel( oLbx2, cFileNumber ) WHEN lAdmin
REDEFINE BUTTON ID 200 OF oDlgEvent ACTION ( lUpd := .T., oDlgEvent:End() ) WHEN ( ! LEFT( cEvent, 1 ) $ "-" ) .AND. ( ! EMPTY( dDate ) ) .AND. ( ! EMPTY( LEFT(cTime,2) ) )
REDEFINE BUTTON ID 201 OF oDlgEvent ACTION ( lUpd := .F., oDlgEvent:End() )
ACTIVATE DIALOG oDlgEvent CENTERED VALID _EventOk( @lUpd, cEvent, dDate, cTime, cBy )
//
//
// Source RC compiled with Pelles C
EVENT DIALOG DISCARDABLE 49, 49, 600, 350
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION
CAPTION "Event Manager"
FONT 10, "tahoma"
{
CONTROL "Event.........................", -1, "Static", WS_GROUP, 5, 7, 75, 8
CONTROL "", 101, "ComboBox", WS_BORDER|CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP, 85, 5, 345, 300
CONTROL "Event Date.................", -1, "Static", WS_GROUP, 5, 21, 75, 8
CONTROL "", 102, "Edit", ES_AUTOHSCROLL|ES_WANTRETURN|ES_UPPERCASE|WS_BORDER|WS_TABSTOP, 85, 20, 45, 12
CONTROL "Event Time................", -1, "Static", WS_GROUP, 5, 36, 75, 8
CONTROL "", 103, "Edit", ES_AUTOHSCROLL|ES_WANTRETURN|ES_UPPERCASE|WS_BORDER|WS_TABSTOP, 85, 35, 45, 12
CONTROL "Event Name...............", -1, "Static", WS_GROUP, 5, 51, 75, 8
CONTROL "", 104, "Edit", ES_AUTOHSCROLL|ES_WANTRETURN|ES_UPPERCASE|WS_BORDER|WS_TABSTOP, 85, 50, 150, 12
CONTROL "Event Notes................", -1, "Static", WS_GROUP, 5, 66, 75, 8
CONTROL "", 105, "Edit", ES_MULTILINE|ES_AUTOVSCROLL|ES_WANTRETURN|ES_UPPERCASE|WS_BORDER|WS_TABSTOP, 85, 65, 345, 30
CONTROL "Display on Cargo Tracking System (CTS)", 106, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 5, 100, 149, 12
CONTROL "E-Mail Shipper", 107, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 5, 115, 60, 12
CONTROL "", 108, "Edit", WS_BORDER|WS_TABSTOP, 85, 115, 345, 12
CONTROL "E-Mail Consignee", 109, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 5, 130, 72, 12
CONTROL "", 110, "Edit", WS_BORDER|WS_TABSTOP, 85, 130, 345, 12
CONTROL "E-Mail Other Party", 111, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 5, 145, 77, 12
CONTROL "", 112, "Edit", WS_BORDER|WS_TABSTOP, 85, 145, 345, 12
CONTROL "OK", 200, "Button", WS_TABSTOP, 540, 5, 50, 14
CONTROL "Cancel", 201, "Button", WS_TABSTOP, 540, 24, 50, 14
CONTROL "Double Click Event below to view details", -1, "Static", SS_CENTER|WS_GROUP, 216, 160, 167, 8
CONTROL "", 6000, "TWBrowse", WS_TABSTOP|0x00b00000, 5, 170, 590, 150
CONTROL "Edit Event", 202, "Button", WS_TABSTOP, 191, 327, 100, 14
CONTROL "Remove Event", 203, "Button", WS_TABSTOP, 309, 327, 100, 14
CONTROL "Military Time", -1, "Static", SS_CENTER|WS_GROUP, 135, 36, 47, 8
}
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact:
Re: Listbox displays incorrect data
Darrell,
Please post the source code for the function _EventDescription()
Please post the source code for the function _EventDescription()
- cdmmaui
- Posts: 693
- Joined: Fri Oct 28, 2005 9:53 am
- Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong
- Contact:
Re: Listbox displays incorrect data
Hi Antonio,
Here is the code:
//-----------------------------------------------------------------------------
FUNCTION _EventDescription( cEventCode, aEvent )
local nX1 :=0, nPos := 0, cReturn := "", cEvent := ""
// Init...
cReturn := cEventCode
FOR nX1=1 TO LEN(aEvent)
nPos := AT('-', cEventCode )
IF nPos>0
cEvent := LEFT( cEventCode, nPos-1 )
IF (LEFT(aEvent[nX1],nPos-1)==cEvent)
cReturn := ALLTRIM( SUBSTR( aEvent[nX1], nPos+1 ) )
EXIT
ENDIF
ENDIF
NEXT nX1
RETURN (cReturn)
Here is the code:
//-----------------------------------------------------------------------------
FUNCTION _EventDescription( cEventCode, aEvent )
local nX1 :=0, nPos := 0, cReturn := "", cEvent := ""
// Init...
cReturn := cEventCode
FOR nX1=1 TO LEN(aEvent)
nPos := AT('-', cEventCode )
IF nPos>0
cEvent := LEFT( cEventCode, nPos-1 )
IF (LEFT(aEvent[nX1],nPos-1)==cEvent)
cReturn := ALLTRIM( SUBSTR( aEvent[nX1], nPos+1 ) )
EXIT
ENDIF
ENDIF
NEXT nX1
RETURN (cReturn)
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact:
Re: Listbox displays incorrect data
Darrell,
In FWH/samples/gallery/onemany/onemany.prg there is an example of use for LISTBOX ... SELECT ... FOR
An index is created like this:
INDEX ON Facturas->Codigo TO "FacCod"
...
ALIAS "Facturas" ;
SELECT Facturas->Codigo FOR Clientes->Codigo
Basically Clientes->Codigo (clients->code) is searched in Facturas->Codigo (invoices->code) and the browse only shows these results
Please check that your PRG does it the same way
In FWH/samples/gallery/onemany/onemany.prg there is an example of use for LISTBOX ... SELECT ... FOR
An index is created like this:
INDEX ON Facturas->Codigo TO "FacCod"
...
ALIAS "Facturas" ;
SELECT Facturas->Codigo FOR Clientes->Codigo
Basically Clientes->Codigo (clients->code) is searched in Facturas->Codigo (invoices->code) and the browse only shows these results
Please check that your PRG does it the same way
- cdmmaui
- Posts: 693
- Joined: Fri Oct 28, 2005 9:53 am
- Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong
- Contact:
Re: Listbox displays incorrect data
Dear Antonio,
We added the ALIAS and UPDATE clauses to the LISTBOX.
The only difference we have with index is that we have a TAG S3 instead of leaving it blank.
I will look at removing TAG S3 to see if that makes a difference.
Thank you,
We added the ALIAS and UPDATE clauses to the LISTBOX.
The only difference we have with index is that we have a TAG S3 instead of leaving it blank.
I will look at removing TAG S3 to see if that makes a difference.
Thank you,
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact:
Re: Listbox displays incorrect data
Darrell,
The index key has to be "file" so the browse can make a search on it for cFileNumber
Please copy here the DBF structure and the INDEX key
The index key has to be "file" so the browse can make a search on it for cFileNumber
Please copy here the DBF structure and the INDEX key
- cdmmaui
- Posts: 693
- Joined: Fri Oct 28, 2005 9:53 am
- Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong
- Contact:
Re: Listbox displays incorrect data
Hi Antonio,
Here is the code we use to create the index, please note that we changed from TAG S1 to TAG S3 when we started having problems.
//----------------------------------------------------------------------------//
static function BuildEvt( nIndex, pText, lEnd )
oMeter:nTotal = RecCount()
nPercent = 0
DO CASE
CASE nIndex=1
cText := "Removing Deleted Event records"
oText:SetText( cText )
PACK
cText := pText
oText:SetText( cText )
INDEX ON file+DTOS(date)+time TAG S1 TO &Pdd.evtx01 EVAL ( oMeter:Set( RecNo() ), SysRefresh(), ! lEnd ) DESCENDING
DBCLEARINDEX()
SysRefresh()
CASE nIndex=2
cText := pText
oText:SetText( cText )
INDEX ON file+DTOS(date)+time TAG S2 TO &Pdd.evtx01 EVAL ( oMeter:Set( RecNo() ), SysRefresh(), ! lEnd )
DBCLEARINDEX()
SysRefresh()
CASE nIndex=3
cText := pText
oText:SetText( cText )
INDEX ON file TAG S3 TO &Pdd.evtx01 EVAL ( oMeter:Set( RecNo() ), SysRefresh(), ! lEnd ) DESCENDING
DBCLEARINDEX()
SysRefresh()
ENDCASE
RETURN nil
Here is the code we use to create the index, please note that we changed from TAG S1 to TAG S3 when we started having problems.
//----------------------------------------------------------------------------//
static function BuildEvt( nIndex, pText, lEnd )
oMeter:nTotal = RecCount()
nPercent = 0
DO CASE
CASE nIndex=1
cText := "Removing Deleted Event records"
oText:SetText( cText )
PACK
cText := pText
oText:SetText( cText )
INDEX ON file+DTOS(date)+time TAG S1 TO &Pdd.evtx01 EVAL ( oMeter:Set( RecNo() ), SysRefresh(), ! lEnd ) DESCENDING
DBCLEARINDEX()
SysRefresh()
CASE nIndex=2
cText := pText
oText:SetText( cText )
INDEX ON file+DTOS(date)+time TAG S2 TO &Pdd.evtx01 EVAL ( oMeter:Set( RecNo() ), SysRefresh(), ! lEnd )
DBCLEARINDEX()
SysRefresh()
CASE nIndex=3
cText := pText
oText:SetText( cText )
INDEX ON file TAG S3 TO &Pdd.evtx01 EVAL ( oMeter:Set( RecNo() ), SysRefresh(), ! lEnd ) DESCENDING
DBCLEARINDEX()
SysRefresh()
ENDCASE
RETURN nil
- cdmmaui
- Posts: 693
- Joined: Fri Oct 28, 2005 9:53 am
- Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong
- Contact:
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact:
Re: Listbox displays incorrect data
Darrell,
Please add the ALIAS event clause here:
REDEFINE LISTBOX oLbx2 FIELDS _EventDescription( event->event, aEvent ) , ;
ALLTRIM( event->notes ) , ;
DTOC(event->date) , ;
event->time , ;
event->by , ;
event->file ;
ID 6000 ;
HEADERS "Event", "Location/Notes", "Date", "Time", "By", "." ;
FIELDSIZES 350 , 350 , 85 , 50 , 200 , 99 ;
SELECT file FOR cFileNumber ;
ON DBLCLICK _EventDet() ;
OF oDlgEvent ;
ALIAS event
Please add the ALIAS event clause here:
REDEFINE LISTBOX oLbx2 FIELDS _EventDescription( event->event, aEvent ) , ;
ALLTRIM( event->notes ) , ;
DTOC(event->date) , ;
event->time , ;
event->by , ;
event->file ;
ID 6000 ;
HEADERS "Event", "Location/Notes", "Date", "Time", "By", "." ;
FIELDSIZES 350 , 350 , 85 , 50 , 200 , 99 ;
SELECT file FOR cFileNumber ;
ON DBLCLICK _EventDet() ;
OF oDlgEvent ;
ALIAS event
- cdmmaui
- Posts: 693
- Joined: Fri Oct 28, 2005 9:53 am
- Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong
- Contact:
Re: Listbox displays incorrect data
Antonio,
I did have ALIAS "event", do you want me to change to ALIAS event instead and place at the end of the code?
I did have ALIAS "event", do you want me to change to ALIAS event instead and place at the end of the code?
- cdmmaui
- Posts: 693
- Joined: Fri Oct 28, 2005 9:53 am
- Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong
- Contact:
Re: Listbox displays incorrect data
Antonio,
We added ALIAS "event" and still did not work
ALIAS event generated error
We added ALIAS "event" and still did not work
ALIAS event generated error
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact:
Re: Listbox displays incorrect data
After SEEK cFileNumber please insert this:
MsgInfo( cFileNumber, cFileNumber == event->file )
and please let me know what you get
MsgInfo( cFileNumber, cFileNumber == event->file )
and please let me know what you get
- Rick Lipkin
- Posts: 2668
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: Listbox displays incorrect data
Darrell
I did not follow your Eval meter part of your index code .. and the macro expansion of the tag name ...
Note that I don't doubt if your code works .. this code seems to work for me:
Rick Lipkin
I did not follow your Eval meter part of your index code .. and the macro expansion of the tag name ...
Code: Select all | Expand
INDEX ON file+DTOS(date)+time TAG S1 TO &Pdd.evtx01 EVAL ( oMeter:Set( RecNo() ), SysRefresh(), ! lEnd ) DESCENDING
Note that I don't doubt if your code works .. this code seems to work for me:
Code: Select all | Expand
//------------------------
FUNC INDEX_PROG()
LOCAL cDEFA := SET(7)
FERASE( cDEFA+"\PROGRAM.CDX" )
SELECT 1
IF NETUSE( "PROGRAM.DBF",.T.,5)
IndexMeter( { | oMeter, oText, oDlg, lEnd | ;
BuildPrg( oMeter, oText, oDlg, @lEnd, 1 ) } , ;
ALIAS()+".dbf tag Program " )
IndexMeter( { | oMeter, oText, oDlg, lEnd | ;
BuildPrg( oMeter, oText, oDlg, @lEnd, 2 ) } , ;
ALIAS()+".dbf tag Progname " )
CLOSE DATABASES
ENDIF
RETURN(NIL)
//-------------------------------------------------------------//
FUNCTION BuildPrg( oMeter, oText, oDlg, lEnd, nTAG )
oMeter:nTotal := lastrec()
DO CASE
CASE nTAG = 1
INDEX on program TAG program ;
EVAL ( oMeter:Set( recno() ), SysRefresh(), !lEnd )
CASE nTAG = 2
INDEX on progname TAG progname ;
EVAL ( oMeter:Set( recno() ), SysRefresh(), !lEnd )
ENDCASE
RETURN( NIL )
Rick Lipkin
- cdmmaui
- Posts: 693
- Joined: Fri Oct 28, 2005 9:53 am
- Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong
- Contact:
Re: Listbox displays incorrect data
Hi Rick,
The meter is defined in the dialog box.
That is not the problem as we have had this for running fine for since the beginning.
Thanks for your help.
Sincerely,
The meter is defined in the dialog box.
That is not the problem as we have had this for running fine for since the beginning.
Thanks for your help.
Sincerely,