Print Using? - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://staging.qb64phoenix.com/forumdisplay.php?fid=10) +---- Thread: Print Using? (/showthread.php?tid=1031) |
Print Using? - james2464 - 11-01-2022 For a clock timer, I'm just wondering if there's a way to make the leading 0 appear when the time is 1:05 etc (I'm getting 1: 5) I'm using the "Print Using" command, and it's fine otherwise, but I'd like that zero to be there. Code: (Select All) 'timer RE: Print Using? - bplus - 11-01-2022 tmp$ = "0#:##" ' NOPE! seems I remember some trick for 0's Code: (Select All) Do RE: Print Using? - mnrvovrfc - 11-01-2022 Code: (Select All) print left$("00", 2 - len(str$(m))) + ltrim$(str$(m)); ":"; left$("00", 2 - len(str$(s))) + ltrim$(str$(s)) RE: Print Using? - Pete - 11-01-2022 Not a PRINT USING fan, either... Lots of ways to do it, this is fairly simple... Code: (Select All) 'timer Pete RE: Print Using? - james2464 - 11-02-2022 Thanks for the responses. A bit of wrestling required to get that zero. Much appreciated! RE: Print Using? - Kernelpanic - 11-02-2022 So the zero is already displayed. . . until it becomes double digits. Code: (Select All) 'timer And - Not very elegant, but simple. Code: (Select All) 'timer RE: Print Using? - PhilOfPerth - 11-02-2022 I would use this: Code: (Select All) 'timer RE: Print Using? - justsomeguy - 11-02-2022 Is this what your looking for? Code: (Select All) 'timer RE: Print Using? - james2464 - 11-02-2022 (11-02-2022, 12:36 AM)justsomeguy Wrote: Is this what your looking for? This is what I was planning to do and thought I'd ask first Just in case there was some time/clock format command that existed for this purpose. I like all the different approaches suggested so far, but the chr$ version is the only one I had in mind before asking. RE: Print Using? - Kernelpanic - 11-02-2022 Quote:Is this what your looking for? It is working! But mighty, mighty complicated Egon, Sven would say. - I made it understanding for myself (Learned something again): Code: (Select All) 'Zeitanzeige. Problem mit "0" geloest (der einzige Weg?) |