Show/Hide Toolbars

EmEditor Help

Navigation: EmEditor Help > Plug-in Reference > Inline Functions

EmEditor Plug-in Reference: Editor_Sort

Scroll Prev Top Next More
EmEditor Home - EmEditor Help - Plug-in Reference - Inline Functions

Editor_Sort

Sorts the document. You can use this inline function or explicitly send the EE_SORT message.

Editor_Sort( HWND hwnd, UINT nFlags, LPCWSTR pszLocale, int nNumOfColumns, COLUMN_INFO* anColumns, BOOL* pbModified );

Parameters

hwnd

Specifies the window handle of the view or frame of EmEditor.

nFlags

Specifies a combination of the following values.

NORM_IGNORECASE

Case is ignored.

NORM_IGNOREKANATYPE

Hiragana and Katakana characters compare as equal.

NORM_IGNORENONSPACE

Nonspacing characters are ignored.

NORM_IGNORESYMBOLS

Symbols are ignored.

NORM_IGNOREWIDTH

The difference between half-width and full-width characters is ignored.

SORT_BINARY_COMPARISON

Fast binary comparison is used to sort. The locale information is ignored.

SORT_DATE

Sorts date and time.

SORT_DIGITSASNUMBERS

Digits are sorted as numbers even when sorted by alphabetical order.

SORT_IGNORE_PREFIX

Leading non-numeric characters are ignored when using Sort Smallest to Largest or Sort Largest to Smallest commands.

SORT_INSPECT_NOT_SEL_ONLY

Inspects the whole lines even when vertical selection or multiple selections exist.

SORT_IPV4

Sorts IPv4 addresses.

SORT_IPV6

Sorts IPv6 addresses.

SORT_LENGTH

Sorts strings by the number of characters.

SORT_LENGTH_VIEW

Full width characters are treated as 2 characters when using Sort Shortest to Longest or Sort Longest to Shortest commands.

SORT_NUM

Sorts numbers.

SORT_GROUP_IDENTICAL

Groups identical strings when sorted by occurrence. Must be specified with SORT_OCCURRENCE.

SORT_OCCURRENCE

Sorts by occurrence.

SORT_RANDOM

Sorts randomly.

SORT_REVERSE

Sorts in reverse order.

SORT_SELECTION_ONLY

Inspects only the selected lines.

SORT_STABLE

Stable sort is used. The stable sort maintains the relative order of records. The stable sort is usually slower.

SORT_STRINGSORT

Punctuation marks are treated the same as symbols.

SORT_TEXT

Sorts text.

SORT_UNQUOTE_CELLS

Compares unquoted strings in cells of CSV documents. For instance, when a cell strings is "a""b", the actual string to compare will be a"b.

SORT_WORDS

Sorts strings by the number of words.

pszLocale

Specifies the locale used to sort. If this is empty, the locale specified in the Customize dialog box is used.

bModified

This field will be set to TRUE if the document is modified while the message is processed, otherwise it will be set to FALSE.

nNumOfColumns

Specifies the number of columns specified in the anColumns field.

anColumns

Specifies an array of COLUMN_INFO structures each of which contains the column to be sorted and the flag to be used. This field cannot be NULL.

Return Values

Returns the HRESULT value. A zero or positive value means success while a negative value means failure.

Version

Supported on EmEditor Professional Version 16.4 or later.

Copyright © 2003-2021 by Emurasoft, Inc.