How can I get data from each column of TSbrowse?
How can I get data from each column of TSbrowse?
Dear All,
I need and informatioin from TSbrowse but I don't konw how to get it when I click on column in each TSbrowse (cCaption or cText) .
Best regards,
Dutch
I need and informatioin from TSbrowse but I don't konw how to get it when I click on column in each TSbrowse (cCaption or cText) .
Best regards,
Dutch
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
Data in each specific Row and Column
Dear Detlef,
Thanks for prompt reply. I mean the text in each column of sbrowse.
for examples
Firstname Lastname Age
1 Kevin Smith 30
2 John Dely 25
3 David Sim 28
4 Ken Donald 34
When I click on column Firstname and row no. 2. The information I need is "John".
Regards,
Dutch
Thanks for prompt reply. I mean the text in each column of sbrowse.
for examples
Firstname Lastname Age
1 Kevin Smith 30
2 John Dely 25
3 David Sim 28
4 Ken Donald 34
When I click on column Firstname and row no. 2. The information I need is "John".
Regards,
Dutch
I found Eval( oBrw:aColumns[ oBrw:nAtCol(nCol) ]:bData ) )
Dear Detlef,
Thanks for your help, I've got it.
Eval( oBrw:aColumns[ oBrw:nAtCol( nCol ) ]:bData )
Regards,
Dutch
Thanks for your help, I've got it.
Eval( oBrw:aColumns[ oBrw:nAtCol( nCol ) ]:bData )
Regards,
Dutch
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
Re: I found Eval( oBrw:aColumns[ oBrw:nAtCol(nCol) ]:bData
Hi Dutchdutch wrote:Dear Detlef,
Thanks for your help, I've got it.
Eval( oBrw:aColumns[ oBrw:nAtCol( nCol ) ]:bData )
Regards,
Dutch
glad you found this out.
If you take the following suggestion you don't need to pass a column number.
eval( oBrw:aColumns[ oBrw:nCell ]:bData )
Best regards,
Detlef
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Thanks and I've another qutestion?
Dear Detlef,
Thanks for another good idea but I try to use Drag and Drop but I cannot get the destination ::bData. Because I can get only nRow but I don't know what the Record number or data in this Row. How can I get the ::bData or Record No. from this drop row?
oBrw:oDragCursor := oCursor
oBrw:bDragBegin := { |nRow,nCol,Flags,Self| SetDropInfo( right(Eval( oBrw:aColumns[ oBrw:nAtCol( nCol ) ]:bData ),10)+ ;
Eval( oBrw:aColumns[ 2 ]:bData ) ) }
oBrw:bDropOver := { |uDropInfo,nRow,nCol,nKeyFlags| if(uDropInfo<>nil, ( MoveRms( uDropInfo+str( Int((nRow-25)/20),3 ), oBrw ) ), ) }
*Now I use this*
Function MoveRms( cData, oLbx )
oLbx:lNoLiteBar := .T.
oLbx:GoTop()
for x := 1 to val(right(cData,3))-1
oLbx:GoDown()
next
oLbx:lNoLiteBar := .F.
return
Best regards,
Dutch
Thanks for another good idea but I try to use Drag and Drop but I cannot get the destination ::bData. Because I can get only nRow but I don't know what the Record number or data in this Row. How can I get the ::bData or Record No. from this drop row?
oBrw:oDragCursor := oCursor
oBrw:bDragBegin := { |nRow,nCol,Flags,Self| SetDropInfo( right(Eval( oBrw:aColumns[ oBrw:nAtCol( nCol ) ]:bData ),10)+ ;
Eval( oBrw:aColumns[ 2 ]:bData ) ) }
oBrw:bDropOver := { |uDropInfo,nRow,nCol,nKeyFlags| if(uDropInfo<>nil, ( MoveRms( uDropInfo+str( Int((nRow-25)/20),3 ), oBrw ) ), ) }
*Now I use this*
Function MoveRms( cData, oLbx )
oLbx:lNoLiteBar := .T.
oLbx:GoTop()
for x := 1 to val(right(cData,3))-1
oLbx:GoDown()
next
oLbx:lNoLiteBar := .F.
return
Best regards,
Dutch
How can I get the drop row information?
Dear James,
I use the master data is database but the ::aColumns are not data in record. I need the data from Drop row but I don't know how to get it.
Best regards,
Dutch
I use the master data is database but the ::aColumns are not data in record. I need the data from Drop row but I don't know how to get it.
Best regards,
Dutch
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
Re: Thanks and I've another qutestion?
Hi Dutch,dutch wrote:Dear Detlef,
Thanks for another good idea but I try to use Drag and Drop but I cannot get the destination ::bData ...
if you already now the record and you just have to find the corresponding dbf field,
i think you will have to use a translation table for your needs:
Code: Select all
#define POS_BRW 1
#define POS_FLD 2
aColFieldPos := {; // BrwPos, FieldPos
{ 1, 1 },; // oBrw:Column 1 shows field# 1
{ 2, 2 },; // oBrw:Column 2 shows field# 2
{ 3, 5 } ; // oBrw Column 3 shows field# 5
}
/* now you just do */
nPos := ascan( aColFieldPos, {|a| a[ POS_BRW ] == oBrw:nCell })
if nPos > 0
xxx->( fieldPut( aColField[ nPos ][POS_FLD ], xValue ) )
endif
Best regards,
Detlef
How to Create Array during TSbrowse create?
Dear Detlef,
I've got it and it is the best way for now, if it cannot get from TSbrowse. How can I make array for each browse row during browse create?
Thanks&Regards,
Dutch
I've got it and it is the best way for now, if it cannot get from TSbrowse. How can I make array for each browse row during browse create?
Thanks&Regards,
Dutch
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Dutch,
TSBrowse (and all the browses) don't support dropping on a row, only dropping on a table. You will probably have to modify the browse source code to get this capability. I do think there was some discussion about this awhile back. You micht try doing a forum search.
>I've got it and it is the best way for now, if it cannot get from TSbrowse. How can I make array for each browse row during browse create?
The easiest way it to browse a database object. A database object already has a built-in buffer array, aBuffer. All the data from the record is read into this array each time the record pointer is moved.
James
TSBrowse (and all the browses) don't support dropping on a row, only dropping on a table. You will probably have to modify the browse source code to get this capability. I do think there was some discussion about this awhile back. You micht try doing a forum search.
>I've got it and it is the best way for now, if it cannot get from TSbrowse. How can I make array for each browse row during browse create?
The easiest way it to browse a database object. A database object already has a built-in buffer array, aBuffer. All the data from the record is read into this array each time the record pointer is moved.
James
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
Re: How to Create Array during TSbrowse create?
Hi Dutch,dutch wrote:Dear Detlef,
I've got it and it is the best way for now, if it cannot get from TSbrowse. How can I make array for each browse row during browse create?
Thanks&Regards,
Dutch
this is not very difficult :
Code: Select all
dbf->( dbEval( { || aadd( aYourArray, --- your data --- ) } ) )
This could be the moment to reflect about (x)Harbour
Regards,
Detlef
Thank you very much Detlef & James
Dear Detlef & James,
I've got it. Thank you very much for your ideas.
Regards,
Dutch
I've got it. Thank you very much for your ideas.
Regards,
Dutch