Page 1 of 1

Str(), StrF() Concatenation

Posted: Tue Aug 30, 2022 1:29 am
by offsides
Here's an elementary concatenation that has me stumped:

Code: Select all

Define.f Hr, Min, Sec 
Seconds = 3661

Hr = Int(Seconds/3600): Rem = Mod(Seconds,3600)
Min = Int(Rem/60)
Sec = Mod(Rem, 60)

Debug Hr
Debug Min
Debug Sec

Debug StrF(Hr) + ":" + StrF(Min) + ":" StrF(Sec) 


Re: Str(), StrF() Concatenation

Posted: Tue Aug 30, 2022 2:35 am
by Demivec
If your question is regarding the syntax error then add a '+' before the last StrF().

Code: Select all

Debug StrF(Hr) + ":" + StrF(Min) + ":" + StrF(Sec) 

Re: Str(), StrF() Concatenation

Posted: Tue Aug 30, 2022 2:43 am
by Allen
Hi,

Just to remind there is a FormatDate command may come in handy.

Code: Select all

Debug FormatDate("%hh:%ii:%ss",3661)
Allen

Re: Str(), StrF() Concatenation

Posted: Tue Aug 30, 2022 3:08 am
by offsides
Oh, man, this is beyond embarrassing, on both counts.

Thanks, Demivec, Allen.