A rule of thumb is: use $define except when the symbol has some use beyond contional compilation; in that case use const. Rather simple really
Quote from: lucamar on December 09, 2019, 07:53:18 pmA rule of thumb is: use $define except when the symbol has some use beyond contional compilation; in that case use const. Rather simple really @lucamar how you will write following code with $define ?Code: Pascal [Select][+][-]const xsmart = 3;...{$if defined(xsmart)}{$if xsmart < 4}...{$elseif xsmart = 4}...{$else}...{$endif}{$else}...{$endif}
@marcov Good.https://stackoverflow.com/questions/1674032/static-const-vs-define-vs-enum
Quote from: julkas on December 10, 2019, 07:23:33 pm@marcov Good.https://stackoverflow.com/questions/1674032/static-const-vs-define-vs-enumQuestions like that don't really transfer languages well. Note that the answers cite C standard paragraphs which are obviously not valid for Pascal