Ada Programming/Attributes/'To Address
< Ada Programming < AttributesComputing » Computer Science » Computer Programming » Ada Programming

Description
System'To_Address (X) is a GNAT specific attribute with the same purpose of function System.Storage_Elements.To_Address. The only difference is that it can be used in preelaborated units where non-static calls are not allowed. X is a value of that type System.Storage_Elements.Integer_Address (an implementation-defined integer type), and note that this attribute is not applied to the type of X but always to package System.
Example
Using the standard Ada To_Address function:
for Sensor'Address use System.Storage_Elements.To_Address (16#0FF2_1234#);
Using the GNAT specific To_Address attribute:
for Sensor'Address use System'To_Address (16#0FF2_1234#);
See also
Wikibook
- Ada Programming
- Ada Programming/Libraries/System.Storage_Elements
GNAT Reference Manual
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.