Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with FormatTimeVal()
#1
I am trying to format a timevalue into a text string. If I use

System::FormatTimeVal
P1=%(LVar:Value)
P2=LVarBig Grinuration
P3=Seconds
P4=

with Value=62590080, then I get the correct number of seconds Duration=175. However, I want to format the output text as "mmConfuseds", not the total seconds.

In the Field Time Text widget the format pattern to give this is %(u):%(s,2,0). If I try it,

System::FormatTimeVal
P1=%(LVar:Value)
P2=LVarBig Grinuration
P3=Pattern
P4="/%u:%(s,2,0)"

I get an error message "Parameter 4 of a "FormatTimeVal" has syntak errors"

What is wrong with this? The documentation only mentions P3 having values of "Seconds" or "Millsec". I found that leaving P3 blank gives a syntax error. Is "Pattern" correct. I am also using the escape sequence "/ in front of the pattern as suggested. Is this correct?

PJG
Reply
#2
You need the () aroud the u, so "%(u):%(s,2,0)" should work.
Dean Roddey
Explorans limites defectum
Reply
#3
Dean Roddey Wrote:You need the () aroud the u, so "%(u):%(s,2,0)" should work.

No it doesn't. Cutting and pasting "%(u):%(s,2,0)" still gives a syntax error.

"%(u)" works, so does "%(u) :" and "%(u) : %(s) ". The problem comes with the "%(s,2,0)" string. An old bug perhaps?

PJG
Reply
#4
Oh, wait, this is in an action command, so you may need to escape the % values, since they are not intended for the action command parameter parsing, and need to pass through. So try:

"\%(u):\%(s,2,0)"

and see if that works. Otherwise, the action command parser may be getting diffused, since it uses tokens also that start with % signs.
Dean Roddey
Explorans limites defectum
Reply
#5
OK "\%(u):\%(s,2,0)" passes the syntax check as I can now save the template. But it fails at runtime with an error message saying the the "Popup Template cannot be loaded". So there is still a problem.

PJG
Reply
#6
Use the action trace window to see what is actually happening.
Dean Roddey
Explorans limites defectum
Reply
#7
I can now see what is happening.

[img] http://www.frignanello.eu/images/FormatTimeFailure.jpg [/img]

First I get the artist name and append it to a local variable LVarTongueLArtists.

Devices::FieldRead2
P1=%(GVarTonguelayerName)
P2=CurItemArtist
P3=LVar:Value
P4=True

LocalVars::AddQListValue
P1=LVarTongueLArtists
P2=%(LVar:Value)

The two lines above work correctly appending the artist name "Cream" to the stringlist.

Then I get the track time, format it to mmConfuseds and append it to the LVar: PLDurations

Devices::FieldRead2
P1=%(GVarTonguelayerName)
P2=CurItemTotal
P3=LVar:Value
P4=True

System::FormatTimeVal
P1=%(LVar:Value)
P2=LVarBig Grinuration
P3=Pattern
P4="\%(u):\%(s,2,0)"

LocalVars::AddQListValue
P1=LVarTongueLDurations
P2=%(LVarBig Grinuration)

However, although the time value is formatted correctly, there are additional "\" characters so the value that gets appended to the string list is "\"2:56\"" rather than "2:56".

As the resulting string list is ""2:56"", ""2:56"" rather than "2:56","2:25" the FieldWrite (CMD:044) fails.

PJG
Reply
#8
Hmmm... Strange. Either the slashes should be required (to escape the percent signs) and therefore removed, or not required at all. I'll take a look at it, but in the meantime, where you do you see it fail if you leave the slashes out?
Dean Roddey
Explorans limites defectum
Reply
#9
Oh, wait, you don't need the quotes on the

P4="\%(u):\%(s,2,0)"

Right? The building up of the quoted comma list will add the quotes, so you are doing double quotes. So it may have been failing before due to the redundant quotes, and the slashes were never actually an issue?
Dean Roddey
Explorans limites defectum
Reply
#10
Dean Roddey Wrote:Oh, wait, you don't need the quotes on the

P4="\%(u):\%(s,2,0)"

Right? The building up of the quoted comma list will add the quotes, so you are doing double quotes. So it may have been failing before due to the redundant quotes, and the slashes were never actually an issue?

\%(u):\%(s,2,0) works correctly. Does the documentation need changing?

I have now hit another problem, but as this is related to the driver, I will post it there.

PJG
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Radar Problems? kblagron 41 22,182 09-02-2017, 06:21 PM
Last Post: Dean Roddey
  Repository + RIVA problems chmilar 7 4,804 03-29-2016, 02:14 PM
Last Post: Dean Roddey
  problems with ZoneBypass, Elk V2 IVB 32 9,236 10-26-2015, 07:42 PM
Last Post: IVB
  Music Player problems rbroders 14 5,721 09-15-2014, 08:12 PM
Last Post: rbroders
  Problems with Dune HD Player pjgregory 3 2,845 01-18-2014, 01:33 AM
Last Post: Dean Roddey
  Audio problems Ron Haley 3 2,811 06-17-2013, 11:01 PM
Last Post: Dean Roddey
  HAI Omni 3.10D problems anogee 10 4,236 10-29-2012, 05:26 PM
Last Post: anogee
  Problems with brand new CQC install SamVimes2 9 4,386 12-31-2011, 12:24 PM
Last Post: SamVimes2
  File Tag Media Browser driver problems znelbok 1 1,673 04-24-2011, 02:51 PM
Last Post: Dean Roddey
  Ever since 3.3 update Major Serial Problems phenix 9 3,462 08-02-2010, 03:34 AM
Last Post: phenix

Forum Jump:


Users browsing this thread: 1 Guest(s)