Subject: SDL-News: Re: Casting from Duration to Integer.
From: Rick Reed TSE (rickreed#tseng.co.uk)
Date: Mon Jul 12 2004 - 19:09:36 GMT
Become an SDL Forum Society member <http://www.sdl-forum.org/Society/members.htm>
The originator of this message is responsible for its content.
-----From Rick Reed TSE <rickreed#tseng.co.uk> to sdlnews -----
Yeoh Chun Yeow at yeow#rndtm.net.my 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
real(THIS Duration) -> Real;
real(THIS Time) -> Real;
and Real also needs and operator
real(THIS Real) -> Real;
-- Rick Reed - rickreed#tseng.co.uk Tel:+44 15394 88462 Mob.:+44 7970 50 96 50
--End text from Rick Reed TSE <rickreed#tseng.co.uk> to sdlnews --- For extra SDL Forum Society benefits join at <http://www.sdl-forum.org/Society/members.htm>
This archive was generated by hypermail 2a23 : Sun May 19 2013 - 23:10:31 GMT