Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h3>Compiler Directives</h3> <p>In general, I'd advise you to be <strong>very</strong> wary of compiler directives. They serve their purpose, but for general use, they should probably be avoided altogether.</p> <p>The first problem is that you have to compile your app and test it twice, because it is fundamentally and/or subtly different for a directive on/off.</p> <p>This situation get worse for each additional directive, because you usually have to permute the combinations:</p> <p>D1 On, D2 On<br> D1 On, D2 Off<br> D1 Off, D2 On<br> D1 Off, D2 Off </p> <p>3 directives is 8 permutations... etc.</p> <h3>Unicode Strings</h3> <p>Please see: <a href="https://stackoverflow.com/questions/2048601/get-ready-for-delphi-2009-and-up-when-developing-with-delphi-7">Get ready for Delphi 2009 and up when developing with Delphi 7?</a><br> It has some nice answers for you to consider.</p> <h3>Question 1</h3> <p>As said, I advise against it. I also advise against for other reasons in my answer to the above mentioned question.</p> <p>More specifically: </p> <ul> <li>In Delphi &lt;2009, both lines are different.</li> <li>In Delphi >=2009 both lines are effectively the same.</li> </ul> <h3>Question 2</h3> <p>Not only is this ill advised for the same reasons as Question 1, but it actually has some subtle problems.</p> <p>The more precise type of <code>Text</code> (String) is determined by your Delphi version. So:</p> <ul> <li>In Delphi &lt;2009, the else part of your conditional casts a single character to a Word. (Probably with no ill effect.)</li> <li>In Delph >=2009, the if part of your conditional casts a double-byte character to a Byte. (With loss of information.)</li> </ul> <p>Also, there are some special considerations, and new support classes for 'special' characters. You'll want to look into those. Refer to: <a href="https://stackoverflow.com/questions/2190989/how-to-identify-unicode-keys-on-key-press">How to identify unicode keys on key press?</a></p> <h3>Question 3</h3> <p>I'm pretty sure that #13 will be treated as a single <strong>character</strong>, so in Delphi >=2009 where <em>Char</em> == WideChar, that <strong>character</strong> will take up 2 bytes.</p> <p>However, again look for <code>Linebreak</code> constants in Delphi. <code>System.sLinebreak</code> was probably introduced back in the Kylix days.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload