forlano Messages: 1185 Registered: March 2006 Location: Italy
Senior Contributor
Hello,
my app crashes with the following box message in debug:
-----------------------------------------------------------
Assertion failed in c:\upp\uppsrc\Core\Format.cpp line 979
0
-----------------------------------------------------------
at the line:
name = NFormat("%sscrgrp.html", TD.PATHDIRWWW);
Instead it does not crash if I use:
name = TD.PATHDIRWWW + "scrgrp.html";
Who can explain me why? (I suspect the two "s" produce some troubble)
Unfortunately, while Format (NFormat is identical to Format for more than year now) maintains similarity to "printf" formating, there is a catch - in order to allow extending Format, the format is specified by ALL alpha characters after the % - so in this case, it is "%sscrgrp". You can delimit it using '`':
"%s`scrgrp.html"
BTW, it release mode, it would most likely worked as expected - if type is not found, Format starts trimming the identifier performing more searches until it founds %s (but of course, this is just to prevent unexpected surprises in legacy code).