Source language: Translate to:

Timeformat in NeobookDX

Plug-ins and utilities of interest to NeoBook authors

Moderator: Neosoft Support

Timeformat in NeobookDX

Postby charles » Fri Jun 18, 2004 7:17 pm

In NeobookDX I use [PlayerID.PositionHMS] to tell how long the player has played.
I only want it to show minutes and seconds.
Is that possible?
charles
 

Timeformat in NeobookDX

Postby Gaev » Fri Jun 18, 2004 8:21 pm

Charles:

I use [PlayerID.PositionHMS] to tell how long the player has played ... I only want it to show minutes and seconds

From the Help file ...

HMSIndicates that the position is formatted as hours:minutes:seconds:ms. For example, zero hours, one minute and 10 seconds would look like: "00:01:10:00".

In NeoBook there is a command to parse this string ...

StrParse "source string" "delimiter" "array variable" "count variable"

... so you could ...

StrParse "[PlayerID.PositionHMS]" ":" "[CharlesTime]" "[CharlesTimeparts]"

... and you will have [CharlesTimeparts] set to 4 (i.e. 4 items in the array ; not important here) ... and you will have ...

[CharlesTime1] set to hh       hours
[CharlesTime2] set to mm       minutes
[CharlesTime3] set to ss       seconds
[CharlesTime4] set to xx       fractional seconds

... so you can then ....

SetVar "[CharlesMinutes]" "([CharlesTime1]*60)+[CharlesTime2]"
SetVar "[ElapsedTime]" "[CharlesMinutes]:[CharlesTime3]"
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada


Return to NeoBook Plug-Ins and Utilities

Who is online

Users browsing this forum: No registered users and 1 guest