RAMP-TSAD05 Step 4. Creating your own SHARED functions
1. Modify the file uf_sy420_rts.js by adding a function named Add to it like this:
/* Add adds 3 numbers together */
Add : function(a,b,c)
{
return(a + b + c);
}, /* <======= Note the comma =========== */
Your code will look like this:
2. Now in your RAMP destination screen script, remove the code from the preceding steps and add these lines of code:
var iResult = SHARED.Add(100,200,136);
alert("Result = " + iResult);
3. Close and restart the Framework.
4. Execute your RAMP 5250 destination screen. You should see a message box like this appear:
That’s it. You have passed arguments to your "Add" function and received back its result. Knowing how to do this is all you need to do to start sharing script logic across all your RAMP scripts.