Hi,
there is a problem browsing an array using the SORT command and non progressive elements.
In this self-contained sample I have a 6 elements array and I want to browse only elements 1 and 6.
As you can see if you try to change the order of the date column then the order is not correct.
See www.softwarexp.co.uk/beta/image1.png to see an image of the problem
Any ideas ?
Thanks in advance
#include "FiveWin.ch"
#include "xbrowse.ch"
function Main()
local oDlg, oBrw, aArray
set date french
set epoch to 1920
aArray:={}
aadd(aArray,{"Marc","Nil1","Nil2","Nil3","Nil4",ctod("31/12/2003")})
aadd(aArray,{"Luc","Nil1","Nil2","Nil3","Nil4",ctod("30/05/2004")})
aadd(aArray,{"George","Nil1","Nil2","Nil3","Nil4",ctod("31/12/2004")})
aadd(aArray,{"Simon","Nil1","Nil2","Nil3","Nil4",ctod("31/12/2005")})
aadd(aArray,{"Janie","Nil1","Nil2","Nil3","Nil4",ctod("31/12/2006")})
aadd(aArray,{"Robert","Nil1","Nil2","Nil3","Nil4",ctod("31/12/2007")})
aadd(aArray,{"Melanie","Nil1","Nil2","Nil3","Nil4",ctod("31/12/2008")})
DEFINE DIALOG oDlg SIZE 300, 200
@0,0 XBROWSE oBrw OF oDlg array aarray
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:lRecordSelector := .f.
ADD COLUMN oCol TO XBROWSE oBrw DATA ARRAY ELEM 1;
HEADER "Name" SIZE 100 ORDER 1
ADD COLUMN oCol TO XBROWSE oBrw DATA ARRAY ELEM 6;
HEADER "Date" SIZE 80 ORDER 2
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTER
return nil
xBrowse: problems with column SORT
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: xBrowse: problems with column SORT
ADD COLUMN oCol TO XBROWSE oBrw DATA ARRAY ELEM 6;
HEADER "Date" SIZE 80 ORDER 6 // not 2
HEADER "Date" SIZE 80 ORDER 6 // not 2
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
Re: xBrowse: problems with column SORT
Hi,
using ORDER 6 isn't possible to change the order for that column.
See source and executable sample on www.softwarex.co.uk/beta/sample.zip
using ORDER 6 isn't possible to change the order for that column.
See source and executable sample on www.softwarex.co.uk/beta/sample.zip
Best Regards,
Marco Turco
SOFTWARE XP LLP
Marco Turco
SOFTWARE XP LLP
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: xBrowse: problems with column SORT
Mr Marco
You are right. Please apply this fix to xbrowse.prg
Line 8708 ( Version 9.04 ) in Method SortArrayData
Existing code:
Change this line as :
Your sample is working fine with this fix in xbrowse.prg. You have to write ORDER 6 ( not 2 ) in your code.
Request Mr Antonio to examine the fix and incorporate if he considers correct.
You are right. Please apply this fix to xbrowse.prg
Line 8708 ( Version 9.04 ) in Method SortArrayData
Existing code:
Code: Select all | Expand
if ValType( nAt ) == 'N' .and. nAt > 0 .and. nAt <= nLen
Change this line as :
Code: Select all | Expand
if ValType( nAt ) == 'N' .and. nAt > 0 .and. nAt <= Len( ::oBrw:aArrayData[ 1 ] )
Your sample is working fine with this fix in xbrowse.prg. You have to write ORDER 6 ( not 2 ) in your code.
Request Mr Antonio to examine the fix and incorporate if he considers correct.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
Re: xBrowse: problems with column SORT
All runs fine now. Thanks for your quick support.
Best Regards,
Marco Turco
SOFTWARE XP LLP
Marco Turco
SOFTWARE XP LLP