// Script function: Creates a recursive/cyclic function and all instances of the function can access the same instance of the variable // Comparison: https://www.globalsino.com/EM/page2597_cyclic_function.s // 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 number GlobalSinoCycle= 0 void GlobalSinoRecursiveFunction(number EMCycleMax, number &GlobalSinoCycle){ // Variable "maxd" created inside a code block of "{}" is local to this block Result("\n GlobalSino Cycle: " + GlobalSinoCycle) if( GlobalSinoCycle < EMCycleMax ){ GlobalSinoCycle++ GlobalSinoRecursiveFunction(EMCycleMax, GlobalSinoCycle) } else Exit(0) } GlobalSinoRecursiveFunction(6, GlobalSinoCycle) // Make GlobalSinoCycle accessible by libraries