define a string as @type {String}

Questions, tips and tricks and techniques for scripting in Servoy

define a string as @type {String}

Postby Harjo » Fri Aug 19, 2011 10:02 am

Hi, another example

I have this piece of code:

Code: Select all
   var vFilePath = plugins.file.getHomeDirectory().getAbsolutePath() + "/.servoy/files"
   if (plugins.file.convertStringToJSFile(vFilePath).exists() != true) {
      plugins.file.convertStringToJSFile(vFilePath).mkdir()
   }


with the warning: The function convertStringToJSFile(String) is not applicable for the arguments (JSFile)

So Servoy still thinks, that this line: var vFilePath = plugins.file.getHomeDirectory().getAbsolutePath() + "/.servoy/files" is a JSFile.

It can now, that it is a string, because, .getAbsolutePath() returns a String, right?
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: define a string as @type {String}

Postby Harjo » Fri Aug 19, 2011 10:12 am

ah, I came across, that

Code: Select all
plugins.file.convertStringToJSFile

is not there anymore in the plugin!
It's now:
Code: Select all
plugins.file.convertToJSFile

With this code it goes oke!
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: define a string as @type {String}

Postby pbakker » Mon Aug 29, 2011 5:21 pm

Didn't you get a deprecation warning on .convertStringToJSFile()?

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands


Return to Methods

Who is online

Users browsing this forum: No registered users and 13 guests