Jump to content

ULSQueryAttr: Difference between revisions

From EDM2
Created page with "==Description== Queries whether or not a character has the specified character attribute. ==Arguments== ULSQueryAttr( char, attribute [, codepage] [, locale] ) Parameters: ..."
 
Ak120 (talk | contribs)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
Queries whether or not a character has the specified character attribute.
Queries whether or not a character has the specified character attribute.


==Arguments==
==Arguments==
ULSQueryAttr( char, attribute [, codepage] [, locale] )
ULSQueryAttr( char, attribute [, codepage] [, locale])
 
Parameters:
 
      char      The character to query.  This must be a valid character for the
                specified codepage.  This may be a multi-byte string if the
                codepage allows multiple bytes per character; however, if the
                string contains more than one valid character, only the first
                one will be considered (the remainder are ignored).


      attribute The name of the attribute to check for. Must be one of the
===Parameters===
                following. (Attributes whose names start with "_" represent
;char:The character to query. This must be a valid character for the specified codepage. This may be a multi-byte string if the codepage allows multiple bytes per character; however, if the string contains more than one valid character, only the first one will be considered (the remainder are ignored).
                Unicode character sets. Those starting with "#" are BIDI
;attribute:The name of the attribute to check for. Must be one of the following. (Attributes whose names start with "_" represent Unicode character sets. Those starting with "#" are BIDI attributes.) The name is not case sensitive.
                attributes.) The name is not case sensitive.
::alnum   Alphabetic and numeric characters
 
::alpha   Letters and linguistic marks
                  alnum           Alphabetic and numeric characters
::ascii   Standard ASCII character
                  alpha           Letters and linguistic marks
::blank   Space and tab characters
                  ascii           Standard ASCII character
::cntrl   Control and format characters
                  blank           Space and tab characters
::digit   Digits 0 through 9
                  cntrl           Control and format characters
::graph   All except controls and space
                  digit           Digits 0 through 9
::lower   Lower case alphabetic character
                  graph           All except controls and space
::number Integral numbers between 0 and 9
                  lower           Lower case alphabetic character
::print   Everything except control characters
                  number           Integral numbers between 0 and 9
::punct   Punctuation marks
                  print           Everything except control characters
::space   Whitespace and line-breaking characters
                  punct           Punctuation marks
::symbol Symbol
                  space           Whitespace and line-breaking characters
::upper   Upper case alphabetic character
                  symbol           Symbol
::xdigit Hexadecimal digits (0-9, a-f, A-F)
                  upper           Upper case alphabetic character
::diacritic Diacritic mark
                  xdigit           Hexadecimal digits (0-9, a-f, A-F)
::fullwidth Full-width variant
                  diacritic       Diacritic mark
::halfwidth Half-width variant
                  fullwidth       Full-width variant
::hiragana   Hiragana character
                  halfwidth       Half-width variant
::ideograph Kanji/Han character
                  hiragana         Hiragana character
::kashida   Arabic tatweel (elongation character)
                  ideograph       Kanji/Han character
::katakana   Katakana character
                  kashida         Arabic tatweel (elongation character)
::nonspacing Non-spacing mark
                  katakana         Katakana character
::nsdiacritic Non-spacing diacritic
                  nonspacing       Non-spacing mark
::nsvowel   Non-spacing vowel
                  nsdiacritic     Non-spacing diacritic
::vowelmark Vowel mark
                  nsvowel         Non-spacing vowel
::_apl       APL character
                  vowelmark       Vowel mark
::_arabic   Arabic character
                  _apl             APL character
::_arrow     Arrow character
                  _arabic         Arabic character
::_bengali   Bengali character
                  _arrow           Arrow character
::_bopomofo Bopomofo character
                  _bengali         Bengali character
::_box       Box or line drawing character
                  _bopomofo       Bopomofo character
::_currency Currency Symbol
                  _box             Box or line drawing character
::_cyrillic Cyrillic character
                  _currency       Currency Symbol
::_dash     Dash character
                  _cyrillic       Cyrillic character
::_devanagari Devanagari character
                  _dash           Dash character
::_dingbat Dingbat
                  _devanagari     Devanagari character
::_fraction Fraction value
                  _dingbat         Dingbat
::_greek     Greek character
                  _fraction       Fraction value
::_gujarati Gujarati character
                  _greek           Greek character
::_gurmukhi Gurmukhi character
                  _gujarati       Gujarati character
::_hanguel   Hangul Jamo character
                  _gurmukhi       Gurmukhi character
::_hebrew   Hebrew character
                  _hanguel         Hangul Jamo character
::_hiragana Hiragana character set
                  _hebrew         Hebrew character
::_katakana Katakana character set
                  _hiragana       Hiragana character set
::_lao       Laotian character
                  _katakana       Katakana character set
_latin          Latin character
                  _lao             Laotian character
_linesep        Line separator
                  _latin          Latin character
_math            Math symbol
                  _linesep        Line separator
_punctstart      Punctuation start
                  _math            Math symbol
_punctend        Punctuation end
                  _punctstart      Punctuation start
_tamil          Tamil character
                  _punctend        Punctuation end
_telegu          Telegu character
                  _tamil          Tamil character
_thai            Thai character
                  _telegu          Telegu character
_userdef        User defined character
                  _thai            Thai character
#arabicnum      Arabic numbers
                  _userdef        User defined character
#blocksep        Block separator
                  #arabicnum      Arabic numbers
#commonsep      Common separator
                  #blocksep        Block separator
#euronum        European number
                  #commonsep      Common separator
#eurosep        European separator
                  #euronum        European number
#euroterm        European terminator
                  #eurosep        European separator
#left            Left to right text orientation
                  #euroterm        European terminator
#mirrored        Symmetrical text orientation
                  #left            Left to right text orientation
#neutral        Other neutral
                  #mirrored        Symmetrical text orientation
#right          Right to left text orientation
                  #neutral        Other neutral
#whitespace      Whitespace
                  #right          Right to left text orientation
;codepage:The source codepage (a positive integer). This is the codepage with which <string> is encoded (i.e. under which it would display correctly). The default is the current process codepage.
                  #whitespace      Whitespace
;locale:The name of the locale whose text-attribute rules are to be used. Locale names are usually of the form "xx_YY", where "xx" is a language and YY is a country (e.g. "en_US", "zh_TW", "it_IT", etc.)  The default is to use the current locale as defined by the LANG and LC_* environment variables.
 
      codepage The source codepage (a positive integer). This is the codepage
                with which <string> is encoded (i.e. under which it would
                display correctly). The default is the current process
                codepage.
 
      locale   The name of the locale whose text-attribute rules are to be
                used. Locale names are usually of the form "xx_YY", where "xx"
                is a language and YY is a country (e.g. "en_US", "zh_TW",
                "it_IT", etc.)  The default is to use the current locale as
                defined by the LANG and LC_* environment variables.


==Returns==
==Returns==
This function returns 1 if the character has the specified attribute, or 0 if it does not.  If an error occurs during the query operation, an empty string ("") is returned and the global ULSERR variable will be set to a non-zero value.
This function returns 1 if the character has the specified attribute, or 0 if it does not.  If an error occurs during the query operation, an empty string ("") is returned and the global ULSERR variable will be set to a non-zero value.
[[Category:RxULS]]

Latest revision as of 14:40, 14 August 2017

Queries whether or not a character has the specified character attribute.

Arguments

ULSQueryAttr( char, attribute [, codepage] [, locale])

Parameters

char
The character to query. This must be a valid character for the specified codepage. This may be a multi-byte string if the codepage allows multiple bytes per character; however, if the string contains more than one valid character, only the first one will be considered (the remainder are ignored).
attribute
The name of the attribute to check for. Must be one of the following. (Attributes whose names start with "_" represent Unicode character sets. Those starting with "#" are BIDI attributes.) The name is not case sensitive.
alnum Alphabetic and numeric characters
alpha Letters and linguistic marks
ascii Standard ASCII character
blank Space and tab characters
cntrl Control and format characters
digit Digits 0 through 9
graph All except controls and space
lower Lower case alphabetic character
number Integral numbers between 0 and 9
print Everything except control characters
punct Punctuation marks
space Whitespace and line-breaking characters
symbol Symbol
upper Upper case alphabetic character
xdigit Hexadecimal digits (0-9, a-f, A-F)
diacritic Diacritic mark
fullwidth Full-width variant
halfwidth Half-width variant
hiragana Hiragana character
ideograph Kanji/Han character
kashida Arabic tatweel (elongation character)
katakana Katakana character
nonspacing Non-spacing mark
nsdiacritic Non-spacing diacritic
nsvowel Non-spacing vowel
vowelmark Vowel mark
_apl APL character
_arabic Arabic character
_arrow Arrow character
_bengali Bengali character
_bopomofo Bopomofo character
_box Box or line drawing character
_currency Currency Symbol
_cyrillic Cyrillic character
_dash Dash character
_devanagari Devanagari character
_dingbat Dingbat
_fraction Fraction value
_greek Greek character
_gujarati Gujarati character
_gurmukhi Gurmukhi character
_hanguel Hangul Jamo character
_hebrew Hebrew character
_hiragana Hiragana character set
_katakana Katakana character set
_lao Laotian character
_latin           Latin character
_linesep         Line separator
_math            Math symbol
_punctstart      Punctuation start
_punctend        Punctuation end
_tamil           Tamil character
_telegu          Telegu character
_thai            Thai character
_userdef         User defined character
#arabicnum       Arabic numbers
#blocksep        Block separator
#commonsep       Common separator
#euronum         European number
#eurosep         European separator
#euroterm        European terminator
#left            Left to right text orientation
#mirrored        Symmetrical text orientation
#neutral         Other neutral
#right           Right to left text orientation
#whitespace      Whitespace
codepage
The source codepage (a positive integer). This is the codepage with which <string> is encoded (i.e. under which it would display correctly). The default is the current process codepage.
locale
The name of the locale whose text-attribute rules are to be used. Locale names are usually of the form "xx_YY", where "xx" is a language and YY is a country (e.g. "en_US", "zh_TW", "it_IT", etc.) The default is to use the current locale as defined by the LANG and LC_* environment variables.

Returns

This function returns 1 if the character has the specified attribute, or 0 if it does not. If an error occurs during the query operation, an empty string ("") is returned and the global ULSERR variable will be set to a non-zero value.