- Hi

the clip below is a tracktime clip, bits of it have been used from other

clips hope the people do not mind ,the problem with the clip is shown at the

end ,how do I get two places when the mod thinks there is one ,other words I

would like always two places.

H="TRACKTIME"

^!Set %N%=0

^!Set %ADD%="^?{NUM=}";%TRACKS%="^?{TRACKS=}"

;Check if the calculator program is open. Jumpt to BringToFront label if

found

^!IfAppOpen Calculator BringToFront ELSE Next

;Calculator program was not open, so now we launch it

^!Shell Calc.exe

;give it enough time to load (4/10th of a second)

^!Delay 4

:BringToFront

;Bring Calculator program to the front

^!FocusApp Calculator

:PressKeys

;Adding By Constant Function

;Set delay of approximately 200 milliseconds between each keystroke

^!KeyboardDelay 200

;Send keystrokes to the calculator utility

^!Keyboard #^%ADD%# $2B $2B

^!FocusApp Calculator

:LOOP

^!INC %n%

^!Keyboard ENTER

^!KeyboardDelay 200

^!Keyboard ALT+E DOWN C

^!SET %RESU%=^$GetClipboard$

^!Set %A%=^$StrCopyRight("^$Calc((^%RESU%-3600*^%RESU%DIV3600)div60)$";2)$

^!Set %A1%=^$StrCopyRight("^$Calc(^%RESU% MOD 60)$";2)$

^!Replace "00:00:00" >> "^%A%:^%A1%:00" S

^!IF ^%N% <= ^$Calc(^%TRACKS%-1)$ LOOP

15:0:00 <------

22:30:00

30:0:00 <-------

37:30:00

thankyou for any help

THANKYOU DAVE M - --- In ntb-clips@yahoogroups.com, "Dave" <dmc43959@...> wrote:
>

words I

> Hi

> end ,how do I get two places when the mod thinks there is one ,other

> ^!Set

%A%=^$StrCopyRight("^$Calc((^%RESU%-3600*^%RESU%DIV3600)div60)$";2)$

> ^!Set %A1%=^$StrCopyRight("^$Calc(^%RESU% MOD 60)$";2)$

Several ways you can do this. The easiest is to use

> ^!Replace "00:00:00" >> "^%A%:^%A1%:00" S

> ^!IF ^%N% <= ^$Calc(^%TRACKS%-1)$ LOOP

^$StrCopyRight("0^%variable%";2)$

for every digit you want to force to 2 digits.

Abair - Dave wrote:
> Hi

I'll be honest Dave, I have no idea what you are doing and so cannot

> the clip below is a tracktime clip, bits of it have been used from other

> clips hope the people do not mind ,the problem with the clip is shown at the

> end ,how do I get two places when the mod thinks there is one ,other words I

> would like always two places.

> H="TRACKTIME"

quite figure it out. It appears you are doing something with times on a

cd track or something for music? Anyway it makes no sense to open the

calculator to do your math. Do it right in notetab with the

^$Calc(1+1)$ function. This is especially important as Vista will

eventually apparently obsolete clips with keyboard commands such as you

are using here.

As to making things two digit, I have a line I use often. If I can

isolate the number I want and check to see if one digit long, I just add

a preceeding 0.

So I think it might be make this:

^!Set %A%=^$StrCopyRight("^$Calc((^%RESU%-3600*^%RESU%DIV3600)div60)$";2)$

^!Set %A1%=^$StrCopyRight("^$Calc(^%RESU% MOD 60)$";2)$

^!Replace "00:00:00" >> "^%A%:^%A1%:00" S

Into this:

^!Set %A%=^$StrCopyRight("^$Calc((^%RESU%-3600*^%RESU%DIV3600)div60)$";2)$

^!Set %A1%=^$StrCopyRight("^$Calc(^%RESU% MOD 60)$";2)$

^!If ^$StrSize("^%A%")$=1 ^!Set %A%=0^%A%

^!If ^$StrSize("^%A1%")$=1 ^!Set %A1%=0^%A1%

^!Replace "00:00:00" >> "^%A%:^%A1%:00" S