Consultor Eletrônico



Kbase P158192: How to pass and manipulate Speedscript variable to Javascript
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   18/02/2011
Status: Unverified

GOAL:

How to pass and manipulate Speedscript variable to Javascript

FACT(s) (Environment):

All Supported Operating Systems
OpenEdge 10.x
WebSpeed 3.x

FIX:

<script language="javascript">
window.alert("i love javascript");
var linebreak = "<br />";
/* speedScript starts */
<!--wss
def var x as char initial 'Hello' no-undo.
def var y as char initial ' World!' no-undo.
def var z as char initial 'Changed' no-undo.
{&out} 'document.write("Speedscript variable: ");'.
{&out} 'document.write("' x + y "<BR>" '");'.
-->
/* speedscript ends */
var z = "` x `` y `"; //Speedscript variables are assigned to global javascript variable
document.write("Global javascript variable = " + z);
function setVar(n)
{

return z = n + "`y`" ; //change of global javascript variable by passing parameter value as well as assigning Speedscript variable

}
document.write(linebreak);

document.write("Global javascript variable changed in function setVar = " + setVar("`z`")); //Speedscript variable passed as a parameter
</script>