Mirsad Todorovac wrote:
... snip ...
So, for example, if High(TString) = 2048, and the code is:
WriteLn (Integer2StringWidth (i, 2200));
what should be done?
(NOTE: this is not the actual function, but a meaningless, but simpler example.)
As long as any valid call cannot return the empty string, I consider using that as an error signal the best method. That passes the decision up to a higher level, which may know what to do. Then the user code should be:
s := Integer2StringWidth(i, 2200); IF strlen(s) > 0 THEN writeln(s) ELSE BEGIN (* take steps *) END;