Difference between revisions of "Ord"

From Lazarus wiki
Jump to navigationJump to search
m
(internal link added for enum, integer, subrange types)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
 
{{Ord}}
 
{{Ord}}
  
Function '''ord''' returns the [[ASCII]] value of the [[Char|char]] '''c'''.
+
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]].
 
 
Declaration
 
    Function ord (c : Char) : byte;
 
 
 
 
 
See also:
 
* [[Chr]]
 
  
[[Category:Pascal]]
+
== see also ==
 +
* {{Doc|package=RTL|unit=system|identifier=ord|text=<syntaxhighlight lang="pascal" inline>ord</syntaxhighlight>}} documented in the [[System unit|system unit]]
 +
* [[Chr|<syntaxhighlight lang="pascal" inline>chr</syntaxhighlight>]] returns a character by its index

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