Welcome, Guest. Please Login
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
Pages: 1
Send Topic Print
Quoting and paths (Read 2254 times)
Mark Anderson
YaBB Administrator

User - not staff!

Posts: 5689
Southsea, UK
Quoting and paths
Mar 2nd, 2010, 4:30am
Here, Sumner Gerard asks:

...it is good to know how to include the path to refer to one particular Exploded Text when needed.  (I'm never sure when to use quotes.)

There aren't rules in the manual on this** on this but this is my advice for those wishing to use a notional rule to avoid surprises.  Paths generally don't need quoting, especially in export codes where (I beieve) they're not expected. If a path contains anything other than- A-Za-z-0-1 or spaces or forward slashes - I would advise enclosing the path in double-quotes. For instance, I had issue using Sumner's ../.. type path notations until I used "../.." instead. Same with note names ending with periods. Under the hood TB does a lot of regular expression parsing of inputs. A period is a regex symbol for 'any character' and by placing my period inside a quoted string I'm pre-emptively telling TB the period is a literal period. Same principle applies more widely.

Bottom line, if you always quote your paths - certainly within any action code - you should have no problems. At minimum should aim to quote any strings using characters other than: A-Z, a-z, 0-9, space, minus (short hyphen) or forward slash.

** TB has the problem of riding two horses here. For the smaller group of very tech literate users these quoting issues are self-evident and forced syntax is merely an unwanted restriction, not least because it generally imposes (if mandatory) a more verbose syntax.  So you don't have to use $-prefixes, you don't have to quote all strings, you don't have to close escape code with a ^, etc. However, that very flexibility of usage is a toxic brew for less code-savvy users as seemingly correct code just fails and the user is forced back to cut'n'paste of what worked before and ... guesswork.

So, if you see me giving suggested rules, like quoting strings, using post v4.6 syntax only, closing escape codes, etc., it's simply to try an navigate around this ambiguity. Mark B will doubtless correct me if these 'rules' are wrong!
Back to top
« Last Edit: Mar 04th, 2010, 4:32am by Mark Anderson »  

Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1
Send Topic Print