backslash problems

Release notes for Servoy betas

backslash problems

Postby gstein » Sun Jun 04, 2006 5:43 pm

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.
gstein
 
Posts: 210
Joined: Tue Jul 27, 2004 2:38 pm

Postby patrick » Sun Jun 04, 2006 5:49 pm

You apply replace to a JSFile, not a stirng. What should work is
Code: Select all
myval.getPath().replace(...)
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3692
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany


Return to Latest Releases

Who is online

Users browsing this forum: No registered users and 1 guest