AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones List Box
  • Effect of ListSort
  • Comparing numeric values
  • Caracteres que se tienen en cuenta para la puntuación y los espacios
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Sorts the elements in a List Box, ListView or Combo Box control populated programmatically. This function has no effect on the File List, File Image List or File Combo Box controls.
Remark: This function is useless if the field has been declared "Sorted" in the field description window ("Detail" tab).
Ejemplo
// Sorts the List Box control in lexicographical order
ListSort(LIST_Customer, True, ccLexicographicOrder)
Sintaxis
ListSort(<List Box control> [, <Sort order> [, <Sort options>]])
<List Box control>: Control name
Name of List Box or Combo Box control to sort.
<Sort order>: Optional boolean
  • True (by default) to perform a sort in ascending order,
  • False to perform a sort in descending order.
<Sort options>: Optional constant (or combination of constants)
Sort options selected for the content of List Box (or Combo Box) control:
ccIgnoreAccentSorts text while ignoring accents
ccIgnoreCaseSorts text while ignoring the case (uppercase/lowercase characters).
ccIgnorePunctuationAndSpaceSorts text while ignoring punctuation and spaces (for more details, see the Remarks)
ccIgnoreSpaceSorts text while ignoring leading and trailing spaces in the strings.
ccLexicographicOrderSorts the strings in lexicographical order (for example, 'é' is between 'e' and 'f').
ccNormalSort while performing a standard comparison, similar to the = operator =.
ccRespectNumericSorts text while taking into account the numeric values within the strings (e.g., "10" comes after "9").
sortDefault
(default value)
Performs a case-insensitive and accent-insensitive sort. Ignores spaces.
sortWithoutFunctionGxxxSort ignores elements of type gImage, gStoredValue, ... By default, these elements are taken into account for sorting.
Observaciones

Effect of ListSort

The ListSort function has a one-off effect: items added to the List Box control or Combo Box control after using the ListSort function will respect the sorting options defined in the control description window.

Comparing numeric values

The ccRespectNumeric constant sorts by taking into account the numeric value represented by digits and not just the alphabetical order of the numbers.
Thus, without the constant ccRespecteNumérique, the following strings will be sorted in this order: "string1", "string10", "string2".
With the constant ccRespecteNumérique, the same strings will be sorted in this order: "string1", "string2", "string10".
Lets' see some examples of comparison performed with and without the ccRespectNumeric constant:
Sorting strings containing digits without the ccRespectNumeric constantSorting strings containing digits with the ccRespectNumeric constant
000
000
001001
00901
011
010009
0909
19
10010
1110
911
Sorting strings containing digits without the ccRespectNumeric constantSorting strings containing digits with the ccRespectNumeric constant
10.00Aa7.00Aa
10.01Gh7.01Ba
10.50Ag7.01Dfe
11.00Aa7.50Fg
7.00Aa7.51Tga
7.01Ba8.00Aa
7.01Dfe8.01Gjk
7.50Fg8.01Ty
7.51Tga8.50Ze
8.00Aa9.00Aa
8.01Gjk9.80Er
8.01Ty9.99Zaaa
8.50Ze10.00Aa
9.00Aa10.01Gh
9.80Er10.50Ag
9.99Zaaa11.00Aa

Caracteres que se tienen en cuenta para la puntuación y los espacios

Los caracteres que se tienen en cuenta para la puntuación y los espacios son proporcionados por el sistema. Para obtener la lista de estos caracteres, escriba el siguiente código WLanguage:
s is string
FOR i = 0 TO 255
IF Charact(i) <> StringFormat(Charact(i), ccIgnorePunctuationAndSpace) THEN
 s += Charact(i)
END
END
Info(s)
ToClipboard(s)
Componente: wd300obj.dll
Versión mínima requerida
  • Versión 12
Esta página también está disponible para…
Comentarios
Exemplo ListSort
ListSort(LIST_List)

ListSort(LSV_Listview)

// Blog com Video e Exemplo

http://windevdesenvolvimento.blogspot.com.br/2016/11/aula-964-curso-windev-listbox-009.html

https://www.youtube.com/watch?v=J-QsqU3GEJA
De matos
04 12 2016
Exemplo Combox Ordem
ListDeleteAll(COMBO_cliente)
FOR EACH cliente
ListAdd(COMBO_cliente,cliente.nome)
END
//Coloca em Ordem
ListSort(COMBO_cliente,True,ccLexicographicOrder)

//Frances
ListeSupprimeTout(COMBO_cliente)
POUR TOUT cliente
ListeAjoute(COMBO_cliente,cliente.nome)
FIN
//Coloca em Ordem
ListeTrie(COMBO_cliente,Vrai,ccOrdreLexicographique)

//Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/03/curso-windev-combox-004-combox-ordemsort.html
De matos AMARILDO
24 03 2016

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local