Page 1 of 1

backslash problems

PostPosted: Sun Jun 04, 2006 5:43 pm
by gstein
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:

Code: Select all
   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.

PostPosted: Sun Jun 04, 2006 5:49 pm
by patrick
You apply replace to a JSFile, not a stirng. What should work is
Code: Select all
myval.getPath().replace(...)