pudieron avanzar en ordenacion de un tree?
- goosfancito
- Posts: 1955
- Joined: Fri Oct 07, 2005 7:08 pm
- 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: pudieron avanzar en ordenacion de un tree?
Ordenación alfabética ?
Lo ideal sería usar un codeblock como se usa con la función ASort()
Aún no está listo
Lo ideal sería usar un codeblock como se usa con la función ASort()
Aún no está listo
- goosfancito
- Posts: 1955
- Joined: Fri Oct 07, 2005 7:08 pm
Re: pudieron avanzar en ordenacion de un tree?
claro,
Yo estoy aun peliandola, si logro ordenar voy a postearlo asi pueden aportar.
Yo estoy aun peliandola, si logro ordenar voy a postearlo asi pueden aportar.
- karinha
- Posts: 7940
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: pudieron avanzar en ordenacion de un tree?
goosfancito, todavía no sé cómo usar el árbol de Fivewin, si no estoy pidiendo demasiado, ¿podrías enviarme un modelo básico para que pueda aprender cómo funciona? Me gustaría hacer un árbol usando los usuarios y sus contraseñas, ¿es posible? Inclusión, borrado e impresión de contraseñas. ¿Lo entiendes? Gracias.
Regards, saludos.
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- goosfancito
- Posts: 1955
- Joined: Fri Oct 07, 2005 7:08 pm
Re: pudieron avanzar en ordenacion de un tree?
dale, no hay drama.
Mañana cuelgo uno el github asi pueden acceder
Mañana cuelgo uno el github asi pueden acceder
- karinha
- Posts: 7940
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: pudieron avanzar en ordenacion de un tree?
goosfancito wrote:dale, no hay drama.
Mañana cuelgo uno el github asi pueden acceder
Gracias. Hágalo lo más simple posible, porque la inteligencia no es mi punto fuerte. jajajajaja
Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- TOTOVIOTTI
- Posts: 430
- Joined: Fri Feb 05, 2010 11:30 am
- Location: San Francisco - Córdoba - Argentina
- Has thanked: 5 times
Re: pudieron avanzar en ordenacion de un tree? (xbrowse)
Hola gente...
retomo de vuelta este hilo.. hay forma de ordenar un tree de un xbrowse?
El AUTOSORT no funciona, hay alguna otra manera de realizarlo?
Muchas gracias!
Roberto
retomo de vuelta este hilo.. hay forma de ordenar un tree de un xbrowse?
El AUTOSORT no funciona, hay alguna otra manera de realizarlo?
Muchas gracias!
Roberto
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: pudieron avanzar en ordenacion de un tree?
May we know your FWH version please?
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: pudieron avanzar en ordenacion de un tree?
May we know your FWH version please?
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- TOTOVIOTTI
- Posts: 430
- Joined: Fri Feb 05, 2010 11:30 am
- Location: San Francisco - Córdoba - Argentina
- Has thanked: 5 times
Re: pudieron avanzar en ordenacion de un tree?
Mr. Nagues...
my version is year 2018... very old... maybe it could be solved from programming with my version...
Roberto
my version is year 2018... very old... maybe it could be solved from programming with my version...
Roberto
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: pudieron avanzar en ordenacion de un tree?
First, you need to modify the fwh program
fwh\source\classes\linklist.prg
In this program please replace the existing METHOD Sort() with this revised new method:
Please include the modified linklist.prg in your project link script.
Then you can sort the Tree as shown in this example program:

fwh\source\classes\linklist.prg
In this program please replace the existing METHOD Sort() with this revised new method:
Code: Select all | Expand
METHOD Sort( lAsc, lRecurs ) CLASS TLinkList
local oPrev, oNext, n, aItems := {}
local oItem
local bSort
DEFAULT lAsc := .t., lRecurs := .f.
if HB_ISBLOCK( lAsc )
bSort := lAsc
lAsc := .t.
else
if HB_ISSTRING( lAsc )
lAsc := ( UPPER( LEFT( lAsc, 1 ) ) == "A" )
else
lAsc := !Empty( lAsc )
endif
if lAsc
bSort := { |x,y| Upper( x:cPrompt ) < Upper( y:cPrompt ) }
else
bSort := { |x,y| Upper( x:cPrompt ) > Upper( y:cPrompt ) }
endif
endif
if ::oFirst == nil
return nil
endif
oPrev := ::oFirst:oPrev
oNext := ::oLast:oNext
::Eval( { |o| AAdd( aItems, o ) }, nil, nil, .f. )
if lRecurs
AEval( aItems, { |o| If( o:oTree == nil,, o:oTree:Sort( bSort, .t. ) ) } )
endif
ASort( aItems,,,bSort )
::oFirst := aItems[ 1 ]
::oFirst:oPrev := oPrev
for n := 2 to Len( aItems )
aItems[ n ]:oPrev := aItems[ n - 1 ]
aItems[ n - 1 ]:SetNext( aItems[ n ] )
next n
::oLast := ATail( aItems )
::oLast:SetNext( oNext )
return nil
Then you can sort the Tree as shown in this example program:
Code: Select all | Expand
#include "fivewin.ch"
function Main()
local oTree
oTree := MakeTree()
XBROWSER oTree AUTOSORT SETUP ( ;
oBrw:aCols[ 1 ]:cSortOrder := { |oCol| SetOrder( oCol ) } ;
)
return nil
static function SetOrder( oCol )
local cOrder := If( oCol:cOrder == "A", "D", "A" )
WITH OBJECT oCol:oBrw
:oTree:Sort( cOrder, .t. )
:GoTop()
END
return cOrder
static function MakeTree()
local oTree
TREE oTree
TREEITEM "DEF"
TREE
TREEITEM "222"
TREEITEM "333"
TREE
TREEITEM "JAN"
TREEITEM "FEB"
TREEITEM "MAR"
ENDTREE
TREEITEM "111"
ENDTREE
TREEITEM "ABC"
TREE
TREEITEM "777"
TREEITEM "333"
TREEITEM "444"
ENDTREE
TREEITEM "CDE"
TREE
TREEITEM "SUN"
TREEITEM "MON"
TREEITEM "TUE"
ENDTREE
ENDTREE
oTree:OpenAll()
return oTree

Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- TOTOVIOTTI
- Posts: 430
- Joined: Fri Feb 05, 2010 11:30 am
- Location: San Francisco - Córdoba - Argentina
- Has thanked: 5 times