Convert numbers (Longint, Real) to time
J?rg Knebel (5/15/14 6:25PM)
Aparajita Fishman (5/15/14 10:31PM)
Keisuke Miyako (5/16/14 12:01AM)
Aparajita Fishman (5/16/14 8:30AM)
J?rg Knebel (5/16/14 9:35AM)
J?rg Knebel (5/15/14 6:25 PM)
Keisuke,
On 15/05/2014, at 18:12 AEST, Keisuke Miyako <Keisuke.Miyako@...
wrote:
color><param>00000,0000,DDEE/param>tthe left operand needs to be
declared beforehand
C_TIME($time)
$time:=Random
/color>
Right, but when the number comes from an OT-object it is a total
different story.
C_Time ($TickTock)
$TickTock:= OT GetLong ($lObjHandle;"TimeAsNumber")
Thanks anyway I'll find a solution.
cheers
Aparajita Fishman (5/15/14 10:31 PM)
color><param>00000,0000,DDEE/param>TThanks for your concerns and yes I
get an Error but I'm close to solve or workaround the problem.
As soon as I find a nice generic solution for that "Number to Time
Problem I'll post it here.
/color>
It's simple to convert a number to a time:
$time:=Time(Time string($number))
Regards,
¬=A0Aparajita
Keisuke Miyako (5/16/14 12:01 AM)
Object Tools was not mentioned in the original post, was it..?
and haw totally different a story is it;
do you get an error or the wrong value?
what if you assign to an intermediate local variable?
On 2014/05/15 17:25, "J?=83¬=B6rg Knebel"
<jknebel@...
wrote:
color><param>00000,0000,DDEE/param>RRight, but when the number comes
from an OT-object it is a total
different story.
C_Time ($TickTock)
$TickTock:= OT GetLong ($lObjHandle;"TimeAsNumber")
Thanks anyway I'll find a solution.
/color>
Aparajita Fishman (5/16/14 8:30 AM)
color><param>8826F,0000,8219/param>$$time:=Time(Time string($number))
/color><color><param>00000,0000,DDEE/param>
Are you serious? You should take:
$time:=?00:00:00?+$number
/color>
Of course I'm serious. But my 4D skills are obviously quite rusty and
I didn't take the time to test enough.
Actually, I can't understand why we're having this conversation at
all. Numbers can be assigned directly to times, even with ObjectTools
involved as the original post mentioned:
$o:=OT New
OT PutLong ($o;"test";130)
C_TIME($t)
$t:=OT GetLong ($o;"test")
ALERT(String($t))
So I can't understand where the error came from.
Regards,
¬=A0Aparajita
J?rg Knebel (5/16/14 9:35 AM)
Keisuke,
On 16/05/2014, at 08:01 AEST, Keisuke Miyako <Keisuke.Miyako@...
wrote:
color><param>00000,0000,DDEE/param>OObject Tools was not mentioned in
the original post, was it..?
and haw totally different a story is it;
do you get an error or the wrong value?
what if you assign to an intermediate local variable?
/color>
Thanks for your concerns and yes I get an Error but I'm close to solve
or workaround the problem.
As soon as I find a nice generic solution for that "Number to Time
Problem I'll post it here.
Thanks everyoune for switching on some lights at the end of the
tunnel. :o)
Cheers
J?=B6rg
Reply to this message
Summary created 5/16/14 at 11:38AM by Intellex Corporation
Comments welcome at: feedback@intellexcorp.com