TimeParse problem, overlooking something?

HARRY

Active Member
Licensed User
Longtime User
Hi,

There are two programs:

The first one sets TimeFormat ("HH:mm:ss"); then does PlotTime=Time(Now). PlotTime is combined into a string with other elements, seperated by |, and written to a cWrite ,cASCII coded file using FileWrite .

The second program sets TimeFormat ("HH:mm:ss") too, reads the data from a cRead, cASCII coded file into a string named Contents, using FileReadToEnd ; does Words()=StrSplit(Contents,"|"). Then PlotTime=Words(5), the last element. So far so good.

The file is exchanged using FTP.

Debugging shows that the contents of PlotTime in both programs are visibly equal.

Now I do PlotTimeTicks=TimeParse(PlotTime). The result =0.

What am I doing wrong?

Harry
 

mjcoon

Well-Known Member
Licensed User
...
PlotTime=Time(Now). PlotTime is combined into a string with other elements, seperated by |, and written to a cWrite ,cASCII coded file using FileWrite .

...

Debugging shows that the contents of PlotTime in both programs are visibly equal.

Now I do PlotTimeTicks=TimeParse(PlotTime). The result =0.

What am I doing wrong?

Harry

Surely PlotTime=Time(Now) yields a number of ticks. Did you not see that number when you did your comparison "visibly equal"?

In which case you do not need
PlotTimeTicks=TimeParse(PlotTime)
because you already have the ticks value.

For the portion you have described you do not need TimeFormat() because all time values are numeric.

Am I right?

Mike.
 

HARRY

Active Member
Licensed User
Longtime User
Hi,

Problem solved. What I did was wrong; TimeParse from just a time doesn't work, of course. Now, program 1 just sends the tick count. Program 2 subtracts the received tick count from the current tick count to calculate the elapsed time.

Harry
 

mjcoon

Well-Known Member
Licensed User
Problem solved. What I did was wrong; TimeParse from just a time doesn't work, of course. Now, program 1 just sends the tick count. Program 2 subtracts the received tick count from the current tick count to calculate the elapsed time.
Harry

It's often useful to know what you are trying to achieve...

Don't understand "TimeParse from just a time doesn't work, of course" because Help says:
Example:
T = TimeParse ("21:34")

So long as you have your solution :sign0089:

Mike.
 
Top