I have a set of constants that need a different name each for
readability. It may not be an array.
For instance:
C1 : constant record_item := .....
C2 : constant record_item := .....
C3 : constant record_item := .....
C4 : constant record_item := .....
C5 : constant record_item := .....
Now in a procedure or a function I have to use one of these constants
for instance:
function X(C : record_item) return record_Item is
  RI : record_item;
begin
  ..
  ..
  RI := C -- This C may only be one of the five constants and not
another record_item
  ..
  ..
   return RI;
end X;
In what way do I test if C is a constant and not another record Item
In what way do I test if C is a constant and not another record Item
I have a set of constants that need a different name each for
readability. It may not be an array.
For instance:
C1 : constant record_item := .....
C2 : constant record_item := .....
C3 : constant record_item := .....
C4 : constant record_item := .....
C5 : constant record_item := .....
Now in a procedure or a function I have to use one of these constants
for instance:
function X(C : record_item) return record_Item is
  RI : record_item;
begin
  ..
  ..
  RI := C -- This C may only be one of the five constants and not
another record_item
  ..
  ..
   return RI;
end X;
In what way do I test if C is a constant and not another record Item
items are different. Not using an array means that the readability of
the of the package will be better.
I have a set of constants that need a different name each forThe reason I want this construction is that it is part of a reusable
readability. It may not be an array.
For instance:
C1 : constant record_item := .....
C2 : constant record_item := .....
C3 : constant record_item := .....
C4 : constant record_item := .....
C5 : constant record_item := .....
Now in a procedure or a function I have to use one of these constants
for instance:
function X(C : record_item) return record_Item is
  RI : record_item;
begin
  ..
  ..
  RI := C -- This C may only be one of the five constants and not
another record_item
  ..
  ..
   return RI;
end X;
In what way do I test if C is a constant and not another record Item
I have a set of constants that need a different name each forIn the meantime I have added a boolean to the record "record_item"in
readability. It may not be an array.
For instance:
C1 : constant record_item := .....
C2 : constant record_item := .....
C3 : constant record_item := .....
C4 : constant record_item := .....
C5 : constant record_item := .....
Now in a procedure or a function I have to use one of these constants
for instance:
function X(C : record_item) return record_Item is
  RI : record_item;
begin
  ..
  ..
  RI := C -- This C may only be one of the five constants and not
another record_item
  ..
  ..
   return RI;
end X;
In what way do I test if C is a constant and not another record Item
Op 13-9-2021 om 19:08 schreef ldries46:The solution that finally worked is:
I have a set of constants that need a different name each forIn the meantime I have added a boolean to the record "record_item"in
readability. It may not be an array.
For instance:
C1 : constant record_item := .....
C2 : constant record_item := .....
C3 : constant record_item := .....
C4 : constant record_item := .....
C5 : constant record_item := .....
Now in a procedure or a function I have to use one of these constants
for instance:
function X(C : record_item) return record_Item is
  RI : record_item;
begin
  ..
  ..
  RI := C -- This C may only be one of the five constants and not
another record_item
  ..
  ..
   return RI;
end X;
In what way do I test if C is a constant and not another record Item
which true means this is a constant and false this not a constant then
in the function XÂ I raise an exception if that boolean if false
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 399 |
Nodes: | 16 (3 / 13) |
Uptime: | 64:46:29 |
Calls: | 8,355 |
Calls today: | 15 |
Files: | 13,159 |
Messages: | 5,893,806 |
Posted today: | 1 |