SDL-News: Re: Casting from Duration to Integer.

Subject: SDL-News: Re: Casting from Duration to Integer.
From: Rick Reed TSE (
Date: Mon Jul 12 2004 - 19:09:36 GMT

Become an SDL Forum Society member <>
The originator of this message is responsible for its content.
-----From Rick Reed TSE <> to sdlnews -----

Yeoh Chun Yeow at wrote on 12/07/04 15:48:

> Hi, Rick Reed
> Is there any way for me to do the csting from Duration to Integer or any
> operator for this?
> Please advice. Thanks

I regret there is no simple trick (like fix/float) for duration according to
the current language definition. However, try and see if:

DCL d Duration, i Integer;
i := <TYPE Duration>fix(d);

works. This may work because in earlier versions of SDL Duration inherited
its properties from Real.

The obvious addition to SDL that is needed is an operator for Duration (and
for Time):

real(THIS Duration) -> Real;

real(THIS Time) -> Real;

and Real also needs and operator

real(THIS Real) -> Real;

Rick Reed -
Tel:+44 15394 88462 Mob.:+44 7970 50 96 50

--End text from Rick Reed TSE <> to sdlnews --- For extra SDL Forum Society benefits join at <>

This archive was generated by hypermail 2a23 : Thu May 09 2013 - 16:05:50 GMT