.#attributes.adb

来自「This contains the following topics and m」· ADB 代码 · 共 17 行

ADB
17
字号
--Attributes
--Ada also provides the ability to enquire about a type or object from within
--the code by using attributes. Some of the attributes for
--discrete types are
with Text_IO; use Text_IO;z
procedure attributes is
begin
   Put ("Integer'first"); -- the smallest Integer
   Put ("Integer'last"); -- the largest integer
   Put ("Processors'succ(M68000)"); -- successor of the M68000
   Put ("Upper_Chars'pred('C')"); -- the predecessor of 'C' ('B')
   Put ("Integer'image(67)"); -- the string " 67" -- space for a '-'
   --put("Integer'value("67")") ;-- the integer 67.
   Put ("Processors'pos(M68030)"); -- the position of M68030 in the type.
   -- (3, position 0 is first).
end attributes;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?