mi_access.adb 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. -- Copyright 2020-2022 Free Software Foundation, Inc.
  2. --
  3. -- This program is free software; you can redistribute it and/or modify
  4. -- it under the terms of the GNU General Public License as published by
  5. -- the Free Software Foundation; either version 3 of the License, or
  6. -- (at your option) any later version.
  7. --
  8. -- This program is distributed in the hope that it will be useful,
  9. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. -- GNU General Public License for more details.
  12. --
  13. -- You should have received a copy of the GNU General Public License
  14. -- along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. with Pck; use Pck;
  16. procedure Mi_Access is
  17. A_String : String (3 .. 5) := "345"; -- STOP
  18. A_String_Access : String_Access;
  19. A_Pointer : Pointer;
  20. begin
  21. Do_Nothing (A_String'Address);
  22. A_String (4) := '6';
  23. A_String_Access := Copy (A_String);
  24. A_Pointer.P := A_String_Access;
  25. Do_Nothing (A_String_Access'Address); -- STOP2
  26. A_String_Access (4) := 'a';
  27. Do_Nothing (A_Pointer'Address);
  28. A_String_Access := Copy("Hi");
  29. A_Pointer.P := A_String_Access;
  30. Do_Nothing (A_String_Access'Address);
  31. A_String_Access := null;
  32. A_Pointer.P := null;
  33. Do_Nothing (A_Pointer'Address); -- STOP3
  34. Do_Nothing (A_String'Address);
  35. end Mi_Access;