Str(), StrF() Concatenation

Just starting out? Need help? Post your questions and find answers here.
offsides
Enthusiast
Enthusiast
Posts: 103
Joined: Sun May 01, 2011 3:09 am
Location: Northern California

Str(), StrF() Concatenation

Post 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) 

PB 5.72 (32-bit) on Win 10.
User avatar
Demivec
Addict
Addict
Posts: 4259
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Str(), StrF() Concatenation

Post 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) 
Allen
Enthusiast
Enthusiast
Posts: 103
Joined: Wed Nov 10, 2021 2:05 am

Re: Str(), StrF() Concatenation

Post 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
offsides
Enthusiast
Enthusiast
Posts: 103
Joined: Sun May 01, 2011 3:09 am
Location: Northern California

Re: Str(), StrF() Concatenation

Post by offsides »

Oh, man, this is beyond embarrassing, on both counts.

Thanks, Demivec, Allen.
PB 5.72 (32-bit) on Win 10.
Post Reply