filepath and quotation marks
Is there a particular reason that filepath will not work if the path is surrounded by quotation marks and it does not have a space in it? I am just bummed that I have to build a conditional to test whether or not the path contains a space before I enclose it with double quotes.
Thanks in advance.
I think that I solved the problem. It had something to do with my use of quotes in sprintf.
I was using sprintf to add subfolders to the path, and I got greedy and had placed append in there as well. To compensate for the added append, I added quotes around the path. This worked fine except when the path did not have a space in it.
sprintf append "%sabs/"
Maybe this will help someone else out.
The problem is not limited to the filepath object. It’s a general
issue with symbols in Max. If quotation marks enclose a string of
characters containing at least one blank, the quotation marks are
interpreted as meta-characters delimiting the string (and overriding
the blank as a delimiter). If there are no blanks between quotation
marks, they are interpreted as literal characters, part of the string.
I have no idea why things were originally built this way, and I’ve
never heard an explanation from either David or Miller about the
logic behind the approach. It has confused untold thousands of Max
users. But changing it now would cause even more confusion and chaos,
so best to get used to it.
————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine | +–> Litter Power & Litter Bundle for Jitter
email@example.com | iCE: Sequencing, Recording, and Interface Building
firstname.lastname@example.org | for Max/MSP
email@example.com | http://www.dspaudio.com/ Extremely cool
| home|chez nous|wir|i nostri http://www.castine.de/
in fact it should be :
The tosymbol object will add the double quotes if necessary.
Note that the documented "symout" argument to sprintf works now, as of
Max 4.5.7, so the tosymbol object shouldn’t be necessary.
Gregory Cornelius wrote:
> Is there a particular reason that filepath will not work if the path
> is surrounded by quotation marks and it does not have a space in it?
> I am just bummed that I have to build a conditional to test whether
> or not the path contains a space before I enclose it with double
If you consequently create the quotation marks with [tosymbol] it will
take care of it.
   
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09