Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

The following is the "Copy File" function from the ScriptMaster FMP12 file. It works as it should. I need to register it as a function, and am having problems getting the return state back (because I don't know enough Java):

***************************************************

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();
}

return true;

***************************************************

 

This is what I was trying to use as a formula in a Set Variable step of an initialization script.

***************************************************

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();
}
return true;")

***************************************************

Please help me get tot he correct formatting of the RegisterGroovy function.

 

Thanks,

Paul Samuelson

Paul,

If you register the function in the Scriptmaster file by clicking on "Register Function" at the bottom of the module, it will take you to another layout that tells you how to incorporate the module. The third choice gives you an option to copy to your clipboard. This will be the correct syntax to paste into a set variable script step. Have you done this? This is what I get when I copy it to the clipboard

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();¶

return true;"; "isGui=false" )

  • Author

Ryan,

I did not know that. That helps a lot!

 

Thank you,

Paul

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.