Difference between revisions of "Ord"

From Lazarus wiki
Jump to navigationJump to search
m (moved ord to Ord)
(internal link added for enum, integer, subrange types)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Function '''ord''' returns the [[ASCII]] value of the [[Char|char]] '''c'''.
+
{{Ord}}
  
Declaration
+
The language construct <syntaxhighlight lang="pascal" inline>ord(someVariable)</syntaxhighlight> evaluates to the index of any ordinal type, including, but not limited to any [[Integer|<syntaxhighlight lang="pascal" inline> integer</syntaxhighlight>]] type and [[subrange_types | sub-ranges]] thereof, [[Char|<syntaxhighlight lang="pascal" inline>char</syntaxhighlight>]], [[Boolean|<syntaxhighlight lang="pascal" inline>boolean</syntaxhighlight>]], or any [[Enum_Type |enumerative type]].
    Function ord (c : Char) : byte;
 
  
 
+
== see also ==
See also:
+
* {{Doc|package=RTL|unit=system|identifier=ord|text=<syntaxhighlight lang="pascal" inline>ord</syntaxhighlight>}} documented in the [[System unit|system unit]]
* [[chr]]
+
* [[Chr|<syntaxhighlight lang="pascal" inline>chr</syntaxhighlight>]] returns a character by its index
 
 
[[Category:Pascal]]
 

Latest revision as of 08:07, 17 October 2023

Deutsch (de) English (en) français (fr) русский (ru)

The language construct ord(someVariable) evaluates to the index of any ordinal type, including, but not limited to any integer type and sub-ranges thereof, char, boolean, or any enumerative type.

see also