[Thread Prev][Thread Next][Index]

Re: [ferret_users] trailing slash in symbol



Marco,

On Fri, Jun 19, 2020 at 6:57 PM Marco van Hulten <Marco.Hulten@xxxxxx> wrote:
I noticed that a trailing slash is ignored for in a string variable,

I guess the correct statement is that trailing slashes are ignored by the commands.

yes? define symbol ss "/abc/"
yes? show symbol ss
SS = "/abc/"
yes? define symbol ss /abc/
yes? show symbol ss
SS = "/abc"

That means that it was the "DEFINE SYMBOL" command which ignored the trailing backslash.

Furthermore,

yes? define symbol ss "/abc/"
yes? say ($ss)
 !-> MESSAGE/CONTINUE /abc
/abc
yes? say "($ss)"
!-> MESSAGE/CONTINUE "/abc/"
/abc/

In this case, it was the SAY command which ignored the trailing backslash.

So, to avoid the trailing slash from being interpreted by the command, you quote the string.

Cheers,
Ryo


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement