| |
| Embedding a quite in a string. |
 |
How can I embed a quote in a string since it is a reserved delimiter?
You can either use two single quote characters where a single quote is required, or define a constant who's value is character number 39. If you have many quotes to embed (this can happen in a complex SQL statement), the second method is preferred.
Example:
const Quote = #39;
{This line will not compile!}
ShowMessage('The smith's yard is greener than ours');
{This line will compile}
ShowMessage('The smith''s yard is greener than ours');
{This line will compile}
ShowMessage('The smith' + Quote + 's yard is greener than ours');
|
|
| Hits/month |
2,500,000+ |
Downloads (Since May 2000) |
7,393,709 |
| Total Files |
6,023 |
| Forum msgs |
7,670 |
| Articles/FAQs |
70+/900+ |
Top Selling Software at Amazon
|