backslash problems

We need to save a file location returned from Servoy’s plugins.file.showFileOpenDialog method. The problem is, the backebd DB we are using is mysql and some of our users are running Windows machines.

Mysql strips off a backslash from an insert statement because it is their escape character, so:

c:\myfolder\mysubfolder\myfile becomes c:myfoldermysubfoldermyfile

I can get around this by putting two backslashes in place of one, so:

c:\myfolder\mysubfolder\myfile becomes c:\myfolder\mysubfolder\myfile

The problem is, in servoy I can’t seem to modify the variable that holds the value returned by the dialog box. I tried:

	var myval = plugins.file.showFileOpenDialog(1);
	myval = myval.replace("\\","\\\\")

but when it runs I get an error: replace is not a function.

Any suggestions on how to deal with this?

Thanks.

You apply replace to a JSFile, not a stirng. What should work is

myval.getPath().replace(...)