Listbox Help
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Listbox Help
Hi Everybody,
I'll try to explain this as best I can....
I have a listbox created from resource.
When the listbox is first created there is no database associated with it
(REDEFINE LISTBOX oLbx ID 131 of oDlg UPDATE)
When the user selects a database file drop a drop down list, I need to display 3 fields from this database.
I need to re-define the listbox with the new database.
I have tried doing a:
REDEFINE Listbox oLbx FIELDS RepData->Time, STR(RepData->Sat), STR(RepData->HR) ID 131 ;
FIELDSIZES 60,35,35 ;
HEAD "Time","SPO2","HR";
of oDlg UPDATE
but it gives me a duplicate ID error.
Any ideas to get around this problem?
Thanks in advance,
Jeff
I'll try to explain this as best I can....
I have a listbox created from resource.
When the listbox is first created there is no database associated with it
(REDEFINE LISTBOX oLbx ID 131 of oDlg UPDATE)
When the user selects a database file drop a drop down list, I need to display 3 fields from this database.
I need to re-define the listbox with the new database.
I have tried doing a:
REDEFINE Listbox oLbx FIELDS RepData->Time, STR(RepData->Sat), STR(RepData->HR) ID 131 ;
FIELDSIZES 60,35,35 ;
HEAD "Time","SPO2","HR";
of oDlg UPDATE
but it gives me a duplicate ID error.
Any ideas to get around this problem?
Thanks in advance,
Jeff
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Jeff,
Try to use three dummy fields since the beginning:
REDEFINE LISTBOX oLbx FIELDS "", "", "" ID 131 of oDlg UPDATE
and later on set its DATA bLine:
oLbx:bLine = { || { RepData->Time, STR(RepData->Sat), STR(RepData->HR) } }
(Please notice that it is a codeblock that returns an array)
and oLbx:Refresh()
Try to use three dummy fields since the beginning:
REDEFINE LISTBOX oLbx FIELDS "", "", "" ID 131 of oDlg UPDATE
and later on set its DATA bLine:
oLbx:bLine = { || { RepData->Time, STR(RepData->Sat), STR(RepData->HR) } }
(Please notice that it is a codeblock that returns an array)
and oLbx:Refresh()
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Enrico,
I have added:
oLbx:bLogicLen = { || RecCount() }
Still get the first record repeated 5 times. Sample of code below.
Function LoadSat() //called from function that displays the listbox
use "\MyFile.dbf" SHARED ALIAS "RepData" NEW
Select RepData
Go Top
oLbx:bLine := { || { RepData->Time, STR(RepData->Sat), STR(RepData->HR) } }
oLbx:bLogicLen()
oLbx:ReFresh()
Return Nil
Any Ideas?
Jeff
I have added:
oLbx:bLogicLen = { || RecCount() }
Still get the first record repeated 5 times. Sample of code below.
Function LoadSat() //called from function that displays the listbox
use "\MyFile.dbf" SHARED ALIAS "RepData" NEW
Select RepData
Go Top
oLbx:bLine := { || { RepData->Time, STR(RepData->Sat), STR(RepData->HR) } }
oLbx:bLogicLen()
oLbx:ReFresh()
Return Nil
Any Ideas?
Jeff
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Now I'm lost ... I don't see any ALIAS clause in the help file. This is what I have in my help file....
REDEFINE LISTBOX [ <oLbx> VAR ] <cnVar> ;
[ ITEMS | PROMPTS <aItems> ] ;
[ FILES | FILESPEC <cFileSpec> ] ;
[ ID <nId> ] ;
[ ON CHANGE <uChange> ] ;
[ ON [ LEFT ] DBLCLICK <uLDblClick> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ HELPID | HELP ID <nHelpId> ] ;
[ BITMAPS [ SIZE <nSize> ] ] ;
[ VALID <uValid> ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <uWhen> ]
[ BITMAPS <aBitmaps> ] ;
[ ON DRAWITEM <uBmpSelect> ]
REDEFINE LISTBOX [ <oLbx> VAR ] <cnVar> ;
[ ITEMS | PROMPTS <aItems> ] ;
[ FILES | FILESPEC <cFileSpec> ] ;
[ ID <nId> ] ;
[ ON CHANGE <uChange> ] ;
[ ON [ LEFT ] DBLCLICK <uLDblClick> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;
[ HELPID | HELP ID <nHelpId> ] ;
[ BITMAPS [ SIZE <nSize> ] ] ;
[ VALID <uValid> ] ;
[ COLOR | COLORS <nClrFore> [,<nClrBack>] ] ;
[ MESSAGE <cMsg> ] ;
[ UPDATE ] ;
[ WHEN <uWhen> ]
[ BITMAPS <aBitmaps> ] ;
[ ON DRAWITEM <uBmpSelect> ]
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact: