4

I want to populate a text field with a path, for example \Layers\SiteVisit but when I try to use '\Layers\SiteVisit' I get an error. It seems the \ symbol is not recognised as a character within the ' '

Can someone please advise?

enter image description here

1

2 Answers 2

9

You can also use \\ if you really want to use that character (eg for consistent display purposes).

7

You have to use / because \ is used to escape any special character.

For example,

file_name('\Layers\SiteVisit.foo')

returns '?ayers?iteVisit.foo'

but

file_name('/Layers/SiteVisit.foo')

returns 'SiteVisit.foo'

1
  • 1
    Thanks!! the \ worked to open the file automatically in a relative path which was my intention. [% @project_folder %][%PATH-ACTIO%]
    – Astrid V
    Oct 13, 2021 at 3:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.