In Tinderbox Action and Export code, only ‘straight’ single quotes (U+0027 APOSTROPHE) or ‘straight’ double quotes (U+0022 QUOTATION MARK) to delimit (i.e. mark the boundaries of) String-type data. So:
$MyString = 'hello';
$MyString = "hello";
Note that such quotes are always used in matched pairs. One type can enclose the other:
$MyString = "hello 'and' goodbye";
By convention but not a requirement, double quotes (U+0022) are the default usage where only one level of quote type is needed. A good example on using single (U+0027) quotes as he delimiters is when making a string of HTML code as HTML element attribute values require to be double quotes, e.g.:
$MyString = '<div class="blue">Test</div>';
IMPORTANT: In code typographic or ‘curly’ quotes† characters are not treated as string delimiters.
Confusion arises as—by default—$Text, as with many writing tools, e.g. $TextEdit, automatically turns your typed straight quotes into the relevant equivalent‡ typographic quotes for visual aesthetics. This is not least because there are no discrete keypad keys for typographic quotes and many user do not know the keyboard shortcuts need to create these characters.
In Tinderbox the $SmartQuotes system attributes controls this behaviour (by default is it true
, i.e. it does allow auto-translation of characters. Note that the Tinderbox build in prototypes, Action, Code and HTML alter $smartQuotes to false
exactly because such behaviour is unwanted when writing code.
†. These four characters are: U+2018 (LEFT SINGLE QUOTATION MARK), U+2019 (RIGHT SINGLE QUOTATION MARK), U+201C (LEFT DOUBLE QUOTATION MARK), U+201D (RIGHT DOUBLE QUOTATION MARK).
‡. Or tries to, using some OS-level logic. But, for instance an abbreviated date like '98 (for 1998)—here not altered by the forum Markdown as it only transposes paired quotes—will often be changed to ‘98 when by convention (in English) it should be ’98 (as the quote indicates the elision of the preceding ‘19’). so the software, tries to get the right typographic version but can fail. Don’t be surprised by this.