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

Taras
  • 32,823
  • 4
  • 66
  • 137
Astrid V
  • 71
  • 3

2 Answers2

9

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

she_weeds
  • 12,488
  • 1
  • 28
  • 58
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'

Taras
  • 32,823
  • 4
  • 66
  • 137
Kadir Şahbaz
  • 76,800
  • 56
  • 247
  • 389
  • 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 '21 at 03:08