Jump to content

Recommended Posts

Hello

I have a FMP solution I did under FMP12 using some scripts from Scriptmaster ; everything runs fine !

Opening this solution in FMP14 Adv when one FM script using SM is executed I get a warning window I join a screen copy. I precise that after that the FM script runs fine till its end.

I don't understand at all what is said and don't know in what direction I must search to avoid this alert.

Thank for your help !

Noël

Capture d'écran 2020-04-18 14.25.25.png

Link to post
Share on other sites

post the code Noel.....

it is to do with the way Groovy 'guesses' or overloads methods based on what it thinks you are working with

So for example if you pass 2 in a function it will guess this is an integer number but if you pass 2.5 it will assume it is the decimal type -both of which are different, and if you pass "2" it will assume this is a string

Somewhere a null value is being used and the code is not trapping for this as an error, neither does Groovy know what to do with that as it could do multiple things.

This is due to a change of Java I think.

Link to post
Share on other sites
Posted (edited)

Hello

I just run the FM script step bys step. And so I found the error : and Scriptmaster is not guilty; it was on CopyFile (src; dest) that the alert occurred. Here is the code

RegisterGroovy( "CopyFile( src ; dest )" ; "InputStream input = new BufferedInputStream(new FileInputStream(src));¶
OutputStream out = new BufferedOutputStream(new FileOutputStream(dest));¶
try {¶
	out << input;¶
} finally {¶
	if (out != null) out.close();¶
	if (input != null) input.close();¶
}"; "isGui=false" )

The error was in the definition of the paths for MacOS only ! Sorry to have disturbed uselessly !
Keep yourself healthy!

Noël

 

Edited by Noél Dubau
Link to post
Share on other sites

Thanks Noel

 

To stop this happening again either do an explicit test for a null input path, or add a catch (e) at the then of your code

 

Try{

//code

} finally {

//code

} catch (e) {

//return a logical error message]

}

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.