I'm not much of a programmer and would greatly appreciate any advice anyone has to offer on this formula problem I'm having. I have two data fields that represent time values but are stored as whole numbers:
SEGSTART - The starting time code of a program segment on a video tape (how much time into the tape the program starts)
SEGLEN - The total duration of the same program segment on the tape
What I'm trying to do is to calculate the ending time of the program segment on the video tape by adding the length of the segment to its start time. The times are stored as 8-digit numbers (hours/minutes/seconds/frames)
An example:
Duration Start Time: 10093000
Duration Length: 00054300
Because these time values are actually stored as whole numbers, these two fields added together total to 10147300 (hours=10, minutes=14, seconds=73, frames=00). What I'm trying to do is obviously to convert this value to a real-time value so it displays properly. It should read 10151300 (10:15:13:00)
The formula I'm using is below. If anyone could help me modify this to display the time values correctly, thanks in advance!
Formula is:
dim hh as Number
dim mm as Number
dim ss as Number
dim ff as Number
hh=Fix(({PGMVERSEG.SEGSTART}+{PGMVERSEG.SEGLEN}) / 1000000)
mm=Fix((({PGMVERSEG.SEGSTART}+{PGMVERSEG.SEGLEN}) mod 1000000)/10000)
ss=Fix((({PGMVERSEG.SEGSTART}+{PGMVERSEG.SEGLEN}) mod 10000)/100)
ff=Fix(({PGMVERSEG.SEGSTART}+{PGMVERSEG.SEGLEN}) mod 100)
rem if ff>24 then ff=ff-25 and ss=ss+1
rem if ss>59 then ss=ss-60 and mm=remainder(+1
rem if mm>59 then mm=mm-60 and hh=hh+1
Formula=ToText(hh,"00")+":"+ToText(mm,"00")+":"+ToText(ss,"00")+":"+ToText(ff,"00")
SEGSTART - The starting time code of a program segment on a video tape (how much time into the tape the program starts)
SEGLEN - The total duration of the same program segment on the tape
What I'm trying to do is to calculate the ending time of the program segment on the video tape by adding the length of the segment to its start time. The times are stored as 8-digit numbers (hours/minutes/seconds/frames)
An example:
Duration Start Time: 10093000
Duration Length: 00054300
Because these time values are actually stored as whole numbers, these two fields added together total to 10147300 (hours=10, minutes=14, seconds=73, frames=00). What I'm trying to do is obviously to convert this value to a real-time value so it displays properly. It should read 10151300 (10:15:13:00)
The formula I'm using is below. If anyone could help me modify this to display the time values correctly, thanks in advance!
Formula is:
dim hh as Number
dim mm as Number
dim ss as Number
dim ff as Number
hh=Fix(({PGMVERSEG.SEGSTART}+{PGMVERSEG.SEGLEN}) / 1000000)
mm=Fix((({PGMVERSEG.SEGSTART}+{PGMVERSEG.SEGLEN}) mod 1000000)/10000)
ss=Fix((({PGMVERSEG.SEGSTART}+{PGMVERSEG.SEGLEN}) mod 10000)/100)
ff=Fix(({PGMVERSEG.SEGSTART}+{PGMVERSEG.SEGLEN}) mod 100)
rem if ff>24 then ff=ff-25 and ss=ss+1
rem if ss>59 then ss=ss-60 and mm=remainder(+1
rem if mm>59 then mm=mm-60 and hh=hh+1
Formula=ToText(hh,"00")+":"+ToText(mm,"00")+":"+ToText(ss,"00")+":"+ToText(ff,"00")