0
votes
Vote UpVote

I used to be a C/C++ programmer.

Delphi Code Monkey – Certain not-very-much-like-C things in Delphi still trip me up. Like this code which I wrote today, expecting it to zero pad my integer values:    var          hour,min:Word;    begin             ...     result := Format('%02d%02d',[hour,min]);      // expected '2400', got '24 0'After a bit of googling, I found that you need this syntax, which seems very unorthodox to me:   result := Format('%.2d%.2d',[hour,min]); As weird as that use of a decimal place in a Format ...
Favorite? Off-Topic? Warren Postma @ 2012-08-24 11:53

Statistics

Visits: 21
Votes: 0
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)