comp.lang.ada
 help / color / mirror / Atom feed
* Is Duration not a discrete type?
@ 2011-03-13  4:32 KK6GM
  2011-03-13  6:16 ` Shark8
  0 siblings, 1 reply; 4+ messages in thread
From: KK6GM @ 2011-03-13  4:32 UTC (permalink / raw)


I'm trying to create a task type with a Duration discriminant and
receive the GNAT error "discriminants must have a discrete or access
type".  Can somebody help me to understand the problem here?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is Duration not a discrete type?
  2011-03-13  4:32 Is Duration not a discrete type? KK6GM
@ 2011-03-13  6:16 ` Shark8
  2011-03-13 16:59   ` KK6GM
  0 siblings, 1 reply; 4+ messages in thread
From: Shark8 @ 2011-03-13  6:16 UTC (permalink / raw)


On Mar 12, 9:32 pm, KK6GM <mjsi...@scriptoriumdesigns.com> wrote:
> I'm trying to create a task type with a Duration discriminant and
> receive the GNAT error "discriminants must have a discrete or access
> type".  Can somebody help me to understand the problem here?

Duration is a Fixed-point type if I remember correctly.

This page, from the `83 LRM, indicates that to be the case:
http://archive.adaic.com/standards/83lrm/html/lrm-09-06.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is Duration not a discrete type?
  2011-03-13  6:16 ` Shark8
@ 2011-03-13 16:59   ` KK6GM
  2011-03-14 10:55     ` Georg Bauhaus
  0 siblings, 1 reply; 4+ messages in thread
From: KK6GM @ 2011-03-13 16:59 UTC (permalink / raw)


On Mar 12, 11:16 pm, Shark8 <onewingedsh...@gmail.com> wrote:
> On Mar 12, 9:32 pm, KK6GM <mjsi...@scriptoriumdesigns.com> wrote:
>
> > I'm trying to create a task type with a Duration discriminant and
> > receive the GNAT error "discriminants must have a discrete or access
> > type".  Can somebody help me to understand the problem here?
>
> Duration is a Fixed-point type if I remember correctly.
>
> This page, from the `83 LRM, indicates that to be the case:http://archive.adaic.com/standards/83lrm/html/lrm-09-06.html

Yes, I didn't realize that fixed-point was not a discrete type.  No
problem, I can just pass in a discrete value that represents
milliseconds and convert to a duration in the task.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is Duration not a discrete type?
  2011-03-13 16:59   ` KK6GM
@ 2011-03-14 10:55     ` Georg Bauhaus
  0 siblings, 0 replies; 4+ messages in thread
From: Georg Bauhaus @ 2011-03-14 10:55 UTC (permalink / raw)


On 13.03.11 17:59, KK6GM wrote:
> On Mar 12, 11:16 pm, Shark8 <onewingedsh...@gmail.com> wrote:
>> On Mar 12, 9:32 pm, KK6GM <mjsi...@scriptoriumdesigns.com> wrote:
>>
>>> I'm trying to create a task type with a Duration discriminant and
>>> receive the GNAT error "discriminants must have a discrete or access
>>> type".  Can somebody help me to understand the problem here?
>>
>> Duration is a Fixed-point type if I remember correctly.
>>
>> This page, from the `83 LRM, indicates that to be the case:http://archive.adaic.com/standards/83lrm/html/lrm-09-06.html
> 
> Yes, I didn't realize that fixed-point was not a discrete type.  No
> problem, I can just pass in a discrete value that represents
> milliseconds and convert to a duration in the task.

Alternatively, using Ada.Realtime,

  ... := To_Duration (Microseconds (you_integer_value));



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-14 10:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-13  4:32 Is Duration not a discrete type? KK6GM
2011-03-13  6:16 ` Shark8
2011-03-13 16:59   ` KK6GM
2011-03-14 10:55     ` Georg Bauhaus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox