
// Script function: function of & in a function 

// Unless named starting with GlobalSino, EM, My, Self, the function commands are defined 
//by Gatan DM, please see at link: http://www.globalsino.com/EM/page2597.html


// To pass by reference, an "&" character is placed before the variable name in the parameter list in the function definition.

void MyEMFunction( number &EMx )

{
    result( "x is " + EMx + "\n" )
    EMx = 2
    result( "x is " + EMx + "\n" )
}

number EMa = 1
MyEMFunction( EMa )

result( "After calling MyEMFunction() a is " + EMa + "\n" )

