From 214ade87a6cef2bf55f9b9f2848ffafc02f37f18 Mon Sep 17 00:00:00 2001
From: Sunil Shetye
Date: Thu, 12 Jul 2018 23:16:08 +0530
Subject: add more global variables

---
 js/Events/ANDBLK.pickle      | 12 ++++++++++--
 js/Events/ANDLOG_f.js        |  4 ++--
 js/Events/ANDLOG_f.pickle    | 10 ++++++++--
 js/Events/CLKSOMV_f.js       |  4 ++--
 js/Events/CLKSOMV_f.pickle   | 10 ++++++++--
 js/Events/CLKSOM_f.js        |  4 ++--
 js/Events/CLKSOM_f.pickle    | 10 ++++++++--
 js/Events/CLKSPLIT_f.pickle  | 10 ++++++++--
 js/Events/END_c.js           | 13 +++++++------
 js/Events/END_c.pickle       | 16 ++++++++++------
 js/Events/EVTDLY_c.js        | 13 +++++++------
 js/Events/EVTDLY_c.pickle    | 18 +++++++++++-------
 js/Events/EVTDLY_f.js        | 13 +++++++------
 js/Events/EVTDLY_f.pickle    | 18 +++++++++++-------
 js/Events/EVTGEN_f.js        | 13 +++++++------
 js/Events/EVTGEN_f.pickle    | 14 +++++++++-----
 js/Events/EVTVARDLY.js       | 13 +++++++------
 js/Events/EVTVARDLY.pickle   | 12 ++++++++----
 js/Events/HALT_f.js          | 13 +++++++------
 js/Events/HALT_f.pickle      | 14 +++++++++-----
 js/Events/IFTHEL_f.js        | 21 +++++++++++----------
 js/Events/IFTHEL_f.pickle    | 16 ++++++++++------
 js/Events/MCLOCK_f.js        |  8 ++++----
 js/Events/MCLOCK_f.pickle    | 16 ++++++++++++----
 js/Events/MFCLCK_f.js        | 13 +++++++------
 js/Events/MFCLCK_f.pickle    | 18 +++++++++++-------
 js/Events/M_freq.js          | 13 +++++++------
 js/Events/M_freq.pickle      | 16 ++++++++++------
 js/Events/VirtualCLK0.js     |  4 ++--
 js/Events/VirtualCLK0.pickle | 10 ++++++++--
 js/Events/freq_div.js        | 11 ++++++-----
 js/Events/freq_div.pickle    | 14 +++++++++-----
 32 files changed, 245 insertions(+), 149 deletions(-)

(limited to 'js/Events')

diff --git a/js/Events/ANDBLK.pickle b/js/Events/ANDBLK.pickle
index d6ad874e..28ad2060 100644
--- a/js/Events/ANDBLK.pickle
+++ b/js/Events/ANDBLK.pickle
@@ -4,8 +4,16 @@ p0
 ((lp1
 S'x'
 p2
-atp3
-Rp4
+aS'model'
+p3
+aS'gr_i'
+p4
+aS'exprs'
+p5
+aS'graphics'
+p6
+atp7
+Rp8
 .(dp0
 S'diagram.objs[1-1]'
 p1
diff --git a/js/Events/ANDLOG_f.js b/js/Events/ANDLOG_f.js
index 64005fef..57909073 100644
--- a/js/Events/ANDLOG_f.js
+++ b/js/Events/ANDLOG_f.js
@@ -8,8 +8,8 @@ function ANDLOG_f() {
         this.model.blocktype = new ScilabString(["d"]);
         this.model.firing = new ScilabDouble([]);
         this.model.dep_ut = new ScilabDouble([false,false]);
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ANDLOG_f\",sz(1),sz(2));"]);
-        this.x = standard_define([3,3],this.model,[],gr_i);
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ANDLOG_f\",sz(1),sz(2));"]);
+        this.x = standard_define([3,3],this.model,[],this.gr_i);
         return new BasicBlock(this.x);
     }
     ANDLOG_f.prototype.details = function ANDLOG_f() {
diff --git a/js/Events/ANDLOG_f.pickle b/js/Events/ANDLOG_f.pickle
index 27c4e0b1..a0fc71ec 100644
--- a/js/Events/ANDLOG_f.pickle
+++ b/js/Events/ANDLOG_f.pickle
@@ -6,8 +6,14 @@ S'x'
 p2
 aS'model'
 p3
-atp4
-Rp5
+aS'gr_i'
+p4
+aS'exprs'
+p5
+aS'graphics'
+p6
+atp7
+Rp8
 .(dp0
 S'model.sim'
 p1
diff --git a/js/Events/CLKSOMV_f.js b/js/Events/CLKSOMV_f.js
index 1f86339f..4eefd652 100644
--- a/js/Events/CLKSOMV_f.js
+++ b/js/Events/CLKSOMV_f.js
@@ -8,8 +8,8 @@ function CLKSOMV_f() {
         this.model.blocktype = new ScilabString(["d"]);
         this.model.firing = new ScilabDouble([-1]);
         this.model.dep_ut = new ScilabDouble([false,false]);
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CLKSOMV_f\",sz(1),sz(2));"]);
-        this.x = standard_define([2,2],this.model,[],gr_i);
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CLKSOMV_f\",sz(1),sz(2));"]);
+        this.x = standard_define([2,2],this.model,[],this.gr_i);
         return new BasicBlock(this.x);
     }
     CLKSOMV_f.prototype.details = function CLKSOMV_f() {
diff --git a/js/Events/CLKSOMV_f.pickle b/js/Events/CLKSOMV_f.pickle
index b77c7073..809d645f 100644
--- a/js/Events/CLKSOMV_f.pickle
+++ b/js/Events/CLKSOMV_f.pickle
@@ -6,8 +6,14 @@ S'x'
 p2
 aS'model'
 p3
-atp4
-Rp5
+aS'gr_i'
+p4
+aS'exprs'
+p5
+aS'graphics'
+p6
+atp7
+Rp8
 .(dp0
 S'model.sim'
 p1
diff --git a/js/Events/CLKSOM_f.js b/js/Events/CLKSOM_f.js
index 44864f88..0c561a9d 100644
--- a/js/Events/CLKSOM_f.js
+++ b/js/Events/CLKSOM_f.js
@@ -8,8 +8,8 @@ function CLKSOM_f() {
         this.model.blocktype = new ScilabString(["d"]);
         this.model.firing = new ScilabDouble([-1]);
         this.model.dep_ut = new ScilabDouble([false,false]);
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CLKSOM_f\",sz(1),sz(2));"]);
-        this.x = standard_define([1,1]/1.2,this.model,[],gr_i);
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CLKSOM_f\",sz(1),sz(2));"]);
+        this.x = standard_define([1,1]/1.2,this.model,[],this.gr_i);
         return new BasicBlock(this.x);
     }
     CLKSOM_f.prototype.details = function CLKSOM_f() {
diff --git a/js/Events/CLKSOM_f.pickle b/js/Events/CLKSOM_f.pickle
index b77c7073..809d645f 100644
--- a/js/Events/CLKSOM_f.pickle
+++ b/js/Events/CLKSOM_f.pickle
@@ -6,8 +6,14 @@ S'x'
 p2
 aS'model'
 p3
-atp4
-Rp5
+aS'gr_i'
+p4
+aS'exprs'
+p5
+aS'graphics'
+p6
+atp7
+Rp8
 .(dp0
 S'model.sim'
 p1
diff --git a/js/Events/CLKSPLIT_f.pickle b/js/Events/CLKSPLIT_f.pickle
index 1c54c2e8..5ae4b378 100644
--- a/js/Events/CLKSPLIT_f.pickle
+++ b/js/Events/CLKSPLIT_f.pickle
@@ -6,8 +6,14 @@ S'x'
 p2
 aS'model'
 p3
-atp4
-Rp5
+aS'gr_i'
+p4
+aS'exprs'
+p5
+aS'graphics'
+p6
+atp7
+Rp8
 .(dp0
 S'model.sim'
 p1
diff --git a/js/Events/END_c.js b/js/Events/END_c.js
index e81cdf1c..107988e7 100644
--- a/js/Events/END_c.js
+++ b/js/Events/END_c.js
@@ -9,9 +9,9 @@ function END_c() {
         this.model.firing = new ScilabDouble([this.tf]);
         this.model.blocktype = new ScilabString(["d"]);
         this.model.dep_ut = new ScilabDouble([false,false]);
-        var exprs = string(this.tf);
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"END_c\",sz(1),sz(2));"]);
-        this.x = standard_define([2,2],this.model,exprs,gr_i);
+        this.exprs = string(this.tf);
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"END_c\",sz(1),sz(2));"]);
+        this.x = standard_define([2,2],this.model,this.exprs,this.gr_i);
         return new BasicBlock(this.x);
     }
     END_c.prototype.details = function END_c() {
@@ -25,17 +25,18 @@ function END_c() {
     }
     END_c.prototype.set = function END_c() {
         this.tf = parseFloat(arguments[0]["tf"])
+        this.exprs = arguments[0]["exprs"]
         this.x = arg1;
         this.graphics = arg1.graphics;
-        var exprs = this.graphics.exprs;
+        this.exprs = this.graphics.exprs;
         this.model = arg1.model;
         while (true) {
-            [ok,this.tf,exprs] = scicos_getvalue("Set final simulation time",["Final simulation time"],list("vec",1),exprs);
+            [ok,this.tf,this.exprs] = scicos_getvalue("Set final simulation time",["Final simulation time"],list("vec",1),this.exprs);
             if (!ok) {
                 break;
             }
             if (ok) {
-                this.graphics.exprs = new ScilabDouble([exprs]);
+                this.graphics.exprs = new ScilabDouble([this.exprs]);
                 this.model.firing = new ScilabDouble([this.tf]);
                 this.x.graphics = this.graphics;
                 this.x.model = this.model;
diff --git a/js/Events/END_c.pickle b/js/Events/END_c.pickle
index a4f46284..c21c176c 100644
--- a/js/Events/END_c.pickle
+++ b/js/Events/END_c.pickle
@@ -2,16 +2,20 @@ c__builtin__
 set
 p0
 ((lp1
-S'tf'
+S'exprs'
 p2
-aS'x'
+aS'gr_i'
 p3
-aS'model'
-p4
 aS'graphics'
+p4
+aS'tf'
 p5
-atp6
-Rp7
+aS'x'
+p6
+aS'model'
+p7
+atp8
+Rp9
 .(dp0
 S'model.sim'
 p1
diff --git a/js/Events/EVTDLY_c.js b/js/Events/EVTDLY_c.js
index 7832ad4f..f3bf27b8 100644
--- a/js/Events/EVTDLY_c.js
+++ b/js/Events/EVTDLY_c.js
@@ -11,9 +11,9 @@ function EVTDLY_c() {
         this.model.blocktype = new ScilabString(["d"]);
         this.model.firing = new ScilabDouble([this.ff]);
         this.model.dep_ut = new ScilabDouble([false,false]);
-        var exprs = [[string(this.dt)],[sci2exp(this.ff)]];
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTDLY_c\",sz(1),sz(2));"]);
-        this.x = standard_define([3,2],this.model,exprs,gr_i);
+        this.exprs = [[string(this.dt)],[sci2exp(this.ff)]];
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTDLY_c\",sz(1),sz(2));"]);
+        this.x = standard_define([3,2],this.model,this.exprs,this.gr_i);
         return new BasicBlock(this.x);
     }
     EVTDLY_c.prototype.details = function EVTDLY_c() {
@@ -29,12 +29,13 @@ function EVTDLY_c() {
     EVTDLY_c.prototype.set = function EVTDLY_c() {
         this.dt = parseFloat(arguments[0]["dt"])
         this.ff = parseFloat(arguments[0]["ff"])
+        this.exprs = arguments[0]["exprs"]
         this.x = arg1;
         this.graphics = arg1.graphics;
-        var exprs = this.graphics.exprs;
+        this.exprs = this.graphics.exprs;
         this.model = arg1.model;
         while (true) {
-            [ok,this.dt,this.ff,exprs] = scicos_getvalue([["Set Event Delay block parameters"],["Delay  is the delay between an input event "],["       and the generated output event"],["Block may initially generate an output event before "],["       any input event. \"Date of initial output event\""],["       gives the date of this event. Set a negative value"],["       to disable any output event."]],["Delay","Date of initial output event"],list("vec",1,"vec",1),exprs);
+            [ok,this.dt,this.ff,this.exprs] = scicos_getvalue([["Set Event Delay block parameters"],["Delay  is the delay between an input event "],["       and the generated output event"],["Block may initially generate an output event before "],["       any input event. \"Date of initial output event\""],["       gives the date of this event. Set a negative value"],["       to disable any output event."]],["Delay","Date of initial output event"],list("vec",1,"vec",1),this.exprs);
             if (!ok) {
                 break;
             }
@@ -43,7 +44,7 @@ function EVTDLY_c() {
                 var ok = false;
             }
             if (ok) {
-                this.graphics.exprs = new ScilabDouble([exprs]);
+                this.graphics.exprs = new ScilabDouble([this.exprs]);
                 this.model.rpar = new ScilabDouble([this.dt],[this.ff]);
                 this.model.firing = new ScilabDouble([this.ff]);
                 this.x.graphics = this.graphics;
diff --git a/js/Events/EVTDLY_c.pickle b/js/Events/EVTDLY_c.pickle
index 60b471e4..55521043 100644
--- a/js/Events/EVTDLY_c.pickle
+++ b/js/Events/EVTDLY_c.pickle
@@ -2,18 +2,22 @@ c__builtin__
 set
 p0
 ((lp1
-S'x'
+S'exprs'
 p2
-aS'model'
+aS'gr_i'
 p3
-aS'dt'
-p4
 aS'ff'
-p5
+p4
 aS'graphics'
+p5
+aS'x'
 p6
-atp7
-Rp8
+aS'model'
+p7
+aS'dt'
+p8
+atp9
+Rp10
 .(dp0
 S'model.sim'
 p1
diff --git a/js/Events/EVTDLY_f.js b/js/Events/EVTDLY_f.js
index ebf8f365..b3e8f166 100644
--- a/js/Events/EVTDLY_f.js
+++ b/js/Events/EVTDLY_f.js
@@ -11,9 +11,9 @@ function EVTDLY_f() {
         this.model.blocktype = new ScilabString(["d"]);
         this.model.firing = new ScilabDouble([this.ff]);
         this.model.dep_ut = new ScilabDouble([false,false]);
-        var exprs = [[string(this.dt)],[sci2exp(this.ff)]];
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTDLY_f\",sz(1),sz(2));"]);
-        this.x = standard_define([2,2],this.model,exprs,gr_i);
+        this.exprs = [[string(this.dt)],[sci2exp(this.ff)]];
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTDLY_f\",sz(1),sz(2));"]);
+        this.x = standard_define([2,2],this.model,this.exprs,this.gr_i);
         return new BasicBlock(this.x);
     }
     EVTDLY_f.prototype.details = function EVTDLY_f() {
@@ -29,12 +29,13 @@ function EVTDLY_f() {
     EVTDLY_f.prototype.set = function EVTDLY_f() {
         this.dt = parseFloat(arguments[0]["dt"])
         this.ff = parseFloat(arguments[0]["ff"])
+        this.exprs = arguments[0]["exprs"]
         this.x = arg1;
         this.graphics = arg1.graphics;
-        var exprs = this.graphics.exprs;
+        this.exprs = this.graphics.exprs;
         this.model = arg1.model;
         while (true) {
-            [ok,this.dt,this.ff,exprs] = scicos_getvalue([["Set Event Delay  block parameters"],["Delay  is the delay between an input event "],["       and the generated output event"],["Block may initially generate an output event before "],["       any input event. \"Date of initial output event\""],["       gives the date of this event. Set a negative value"],["       if no initial event required"]],["Delay","Date of initial output event"],list("vec",1,"vec",1),exprs);
+            [ok,this.dt,this.ff,this.exprs] = scicos_getvalue([["Set Event Delay  block parameters"],["Delay  is the delay between an input event "],["       and the generated output event"],["Block may initially generate an output event before "],["       any input event. \"Date of initial output event\""],["       gives the date of this event. Set a negative value"],["       if no initial event required"]],["Delay","Date of initial output event"],list("vec",1,"vec",1),this.exprs);
             if (!ok) {
                 break;
             }
@@ -43,7 +44,7 @@ function EVTDLY_f() {
                 var ok = false;
             }
             if (ok) {
-                this.graphics.exprs = new ScilabDouble([exprs]);
+                this.graphics.exprs = new ScilabDouble([this.exprs]);
                 this.model.rpar = new ScilabDouble([this.dt]);
                 this.model.firing = new ScilabDouble([this.ff]);
                 this.x.graphics = this.graphics;
diff --git a/js/Events/EVTDLY_f.pickle b/js/Events/EVTDLY_f.pickle
index 55d2d19b..21700f9b 100644
--- a/js/Events/EVTDLY_f.pickle
+++ b/js/Events/EVTDLY_f.pickle
@@ -2,18 +2,22 @@ c__builtin__
 set
 p0
 ((lp1
-S'x'
+S'exprs'
 p2
-aS'model'
+aS'gr_i'
 p3
-aS'dt'
-p4
 aS'ff'
-p5
+p4
 aS'graphics'
+p5
+aS'x'
 p6
-atp7
-Rp8
+aS'model'
+p7
+aS'dt'
+p8
+atp9
+Rp10
 .(dp0
 S'model.sim'
 p1
diff --git a/js/Events/EVTGEN_f.js b/js/Events/EVTGEN_f.js
index b40c24f6..297b0784 100644
--- a/js/Events/EVTGEN_f.js
+++ b/js/Events/EVTGEN_f.js
@@ -8,9 +8,9 @@ function EVTGEN_f() {
         this.model.blocktype = new ScilabString(["d"]);
         this.model.firing = new ScilabDouble([this.tt]);
         this.model.dep_ut = new ScilabDouble([false,false]);
-        var exprs = string(this.tt);
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTGEN_f\",sz(1),sz(2));"]);
-        this.x = standard_define([3,2],this.model,exprs,gr_i);
+        this.exprs = string(this.tt);
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTGEN_f\",sz(1),sz(2));"]);
+        this.x = standard_define([3,2],this.model,this.exprs,this.gr_i);
         return new BasicBlock(this.x);
     }
     EVTGEN_f.prototype.details = function EVTGEN_f() {
@@ -24,16 +24,17 @@ function EVTGEN_f() {
     }
     EVTGEN_f.prototype.set = function EVTGEN_f() {
         this.tt = parseFloat(arguments[0]["tt"])
+        this.exprs = arguments[0]["exprs"]
         this.x = arg1;
         this.graphics = arg1.graphics;
-        var exprs = this.graphics.exprs;
+        this.exprs = this.graphics.exprs;
         this.model = arg1.model;
         while (true) {
-            [ok,this.tt,exprs] = scicos_getvalue("Set Event time",["Event Time"],list("vec",1),exprs);
+            [ok,this.tt,this.exprs] = scicos_getvalue("Set Event time",["Event Time"],list("vec",1),this.exprs);
             if (!ok) {
                 break;
             }
-            this.graphics.exprs = new ScilabDouble([exprs]);
+            this.graphics.exprs = new ScilabDouble([this.exprs]);
             if (this.model.firing!=this.tt) {
                 this.model.firing = new ScilabDouble([this.tt]);
             }
diff --git a/js/Events/EVTGEN_f.pickle b/js/Events/EVTGEN_f.pickle
index 50c53ccb..ce268c69 100644
--- a/js/Events/EVTGEN_f.pickle
+++ b/js/Events/EVTGEN_f.pickle
@@ -2,16 +2,20 @@ c__builtin__
 set
 p0
 ((lp1
-S'x'
+S'tt'
 p2
-aS'model'
+aS'exprs'
 p3
-aS'tt'
+aS'gr_i'
 p4
 aS'graphics'
 p5
-atp6
-Rp7
+aS'x'
+p6
+aS'model'
+p7
+atp8
+Rp9
 .(dp0
 S'model.sim'
 p1
diff --git a/js/Events/EVTVARDLY.js b/js/Events/EVTVARDLY.js
index 3c2f451b..8b95fda9 100644
--- a/js/Events/EVTVARDLY.js
+++ b/js/Events/EVTVARDLY.js
@@ -10,9 +10,9 @@ function EVTVARDLY() {
         this.model.firing = new ScilabDouble([-1]);
         this.model.blocktype = new ScilabString(["c"]);
         this.model.dep_ut = new ScilabDouble([true,false]);
-        var exprs = string(this.model.firing);
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTVARDLY\",sz(1),sz(2));"]);
-        this.x = standard_define([2,2],this.model,exprs,gr_i);
+        this.exprs = string(this.model.firing);
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTVARDLY\",sz(1),sz(2));"]);
+        this.x = standard_define([2,2],this.model,this.exprs,this.gr_i);
         return new BasicBlock(this.x);
     }
     EVTVARDLY.prototype.details = function EVTVARDLY() {
@@ -25,16 +25,17 @@ function EVTVARDLY() {
     }
     EVTVARDLY.prototype.set = function EVTVARDLY() {
         this.fir = arguments[0]["fir"]
+        this.exprs = arguments[0]["exprs"]
         this.x = arg1;
         this.graphics = arg1.graphics;
-        var exprs = this.graphics.exprs;
+        this.exprs = this.graphics.exprs;
         this.model = arg1.model;
         while (true) {
-            [ok,this.fir,exprs] = scicos_getvalue("Set parameter of variable event delay","Initial event firing time (<0 if absent)",list("vec",1),exprs);
+            [ok,this.fir,this.exprs] = scicos_getvalue("Set parameter of variable event delay","Initial event firing time (<0 if absent)",list("vec",1),this.exprs);
             if (!ok) {
                 break;
             }
-            this.graphics.exprs = new ScilabDouble([exprs]);
+            this.graphics.exprs = new ScilabDouble([this.exprs]);
             this.model.firing = new ScilabDouble([this.fir]);
             this.x.graphics = this.graphics;
             this.x.model = this.model;
diff --git a/js/Events/EVTVARDLY.pickle b/js/Events/EVTVARDLY.pickle
index 9d2598f9..06641b49 100644
--- a/js/Events/EVTVARDLY.pickle
+++ b/js/Events/EVTVARDLY.pickle
@@ -4,14 +4,18 @@ p0
 ((lp1
 S'fir'
 p2
-aS'x'
+aS'exprs'
 p3
-aS'model'
+aS'gr_i'
 p4
 aS'graphics'
 p5
-atp6
-Rp7
+aS'x'
+p6
+aS'model'
+p7
+atp8
+Rp9
 .(dp0
 S'model.sim'
 p1
diff --git a/js/Events/HALT_f.js b/js/Events/HALT_f.js
index efd0e1f9..18a45667 100644
--- a/js/Events/HALT_f.js
+++ b/js/Events/HALT_f.js
@@ -9,9 +9,9 @@ function HALT_f() {
         this.model.ipar = new ScilabDouble([0]);
         this.model.blocktype = new ScilabString(["d"]);
         this.model.dep_ut = new ScilabDouble([false,false]);
-        var exprs = string(this.n);
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"HALT_f\",sz(1),sz(2));"]);
-        this.x = standard_define([2,2],this.model,exprs,gr_i);
+        this.exprs = string(this.n);
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"HALT_f\",sz(1),sz(2));"]);
+        this.x = standard_define([2,2],this.model,this.exprs,this.gr_i);
         return new BasicBlock(this.x);
     }
     HALT_f.prototype.details = function HALT_f() {
@@ -25,17 +25,18 @@ function HALT_f() {
     }
     HALT_f.prototype.set = function HALT_f() {
         this.n = parseFloat(arguments[0]["n"])
+        this.exprs = arguments[0]["exprs"]
         this.x = arg1;
         this.graphics = arg1.graphics;
-        var exprs = this.graphics.exprs;
+        this.exprs = this.graphics.exprs;
         this.model = arg1.model;
         while (true) {
-            [ok,this.n,exprs] = scicos_getvalue("Set Halt block parameters",["State on halt"],list("vec",1),exprs);
+            [ok,this.n,this.exprs] = scicos_getvalue("Set Halt block parameters",["State on halt"],list("vec",1),this.exprs);
             if (!ok) {
                 break;
             }
             if (ok) {
-                this.graphics.exprs = new ScilabDouble([exprs]);
+                this.graphics.exprs = new ScilabDouble([this.exprs]);
                 this.model.ipar = new ScilabDouble([this.n]);
                 this.x.graphics = this.graphics;
                 this.x.model = this.model;
diff --git a/js/Events/HALT_f.pickle b/js/Events/HALT_f.pickle
index e639bd1c..d52d6b00 100644
--- a/js/Events/HALT_f.pickle
+++ b/js/Events/HALT_f.pickle
@@ -2,16 +2,20 @@ c__builtin__
 set
 p0
 ((lp1
-S'x'
+S'n'
 p2
-aS'model'
+aS'exprs'
 p3
-aS'n'
+aS'gr_i'
 p4
 aS'graphics'
 p5
-atp6
-Rp7
+aS'x'
+p6
+aS'model'
+p7
+atp8
+Rp9
 .(dp0
 S'model.sim'
 p1
diff --git a/js/Events/IFTHEL_f.js b/js/Events/IFTHEL_f.js
index 0c4bc116..e489695e 100644
--- a/js/Events/IFTHEL_f.js
+++ b/js/Events/IFTHEL_f.js
@@ -13,9 +13,9 @@ function IFTHEL_f() {
         this.model.dep_ut = new ScilabDouble([true,false]);
         this.model.nmode = new ScilabDouble([1]);
         this.model.nzcross = new ScilabDouble([1]);
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IFTHEL_f\",sz(1),sz(2));"]);
-        var exprs = [[string(this.model.in1)],[string(this.model.nmode)]];
-        this.x = standard_define([3,3],this.model,exprs,gr_i);
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IFTHEL_f\",sz(1),sz(2));"]);
+        this.exprs = [[string(this.model.in1)],[string(this.model.nmode)]];
+        this.x = standard_define([3,3],this.model,this.exprs,this.gr_i);
         return new BasicBlock(this.x);
     }
     IFTHEL_f.prototype.details = function IFTHEL_f() {
@@ -31,18 +31,19 @@ function IFTHEL_f() {
     IFTHEL_f.prototype.set = function IFTHEL_f() {
         this.inh = inverse(arguments[0]["inh"])
         this.nmod = parseFloat(arguments[0]["nmod"])
+        this.exprs = arguments[0]["exprs"]
         this.x = arg1;
         this.graphics = arg1.graphics;
-        var exprs = this.graphics.exprs;
+        this.exprs = this.graphics.exprs;
         this.model = arg1.model;
-        if (exprs==[]) {
-            var exprs = string(1);
+        if (this.exprs==[]) {
+            this.exprs = string(1);
         }
-        if (size(exprs,"*")==1) {
-            exprs[2-1] = string(1);
+        if (size(this.exprs,"*")==1) {
+            this.exprs[2-1] = string(1);
         }
         while (true) {
-            [ok,this.inh,this.nmod,exprs] = scicos_getvalue("Set parameters",["Inherit (1: no, 0: yes)","zero-crossing (0: no, 1: yes)"],list("vec",1,"vec",1),exprs);
+            [ok,this.inh,this.nmod,this.exprs] = scicos_getvalue("Set parameters",["Inherit (1: no, 0: yes)","zero-crossing (0: no, 1: yes)"],list("vec",1,"vec",1),this.exprs);
             if (!ok) {
                 break;
             }
@@ -58,7 +59,7 @@ function IFTHEL_f() {
             this.graphics = tmpvar0[1];
             var ok = tmpvar0[2];
             if (ok) {
-                this.graphics.exprs = new ScilabString([exprs]);
+                this.graphics.exprs = new ScilabString([this.exprs]);
                 this.model.evtin = new ScilabDouble(this.inh);
                 this.model.sim[2-1] = new ScilabDouble([-1]);
                 this.model.nmode = new ScilabDouble([this.nmod]);
diff --git a/js/Events/IFTHEL_f.pickle b/js/Events/IFTHEL_f.pickle
index d2685e9e..d83faa7a 100644
--- a/js/Events/IFTHEL_f.pickle
+++ b/js/Events/IFTHEL_f.pickle
@@ -2,18 +2,22 @@ c__builtin__
 set
 p0
 ((lp1
-S'x'
+S'nmod'
 p2
-aS'model'
+aS'exprs'
 p3
-aS'inh'
+aS'gr_i'
 p4
-aS'nmod'
+aS'inh'
 p5
 aS'graphics'
 p6
-atp7
-Rp8
+aS'x'
+p7
+aS'model'
+p8
+atp9
+Rp10
 .(dp0
 S'arg1'
 p1
diff --git a/js/Events/MCLOCK_f.js b/js/Events/MCLOCK_f.js
index 0866962b..564d5370 100644
--- a/js/Events/MCLOCK_f.js
+++ b/js/Events/MCLOCK_f.js
@@ -3,12 +3,12 @@ function MCLOCK_f() {
     MCLOCK_f.prototype.define = function MCLOCK_f() {
         var nn = 2;
         var dt = 0.1;
-        var exprs = [[string(dt)],[string(nn)]];
+        this.exprs = [[string(dt)],[string(nn)]];
         var mfclck = MFCLCK_f("define");
         mfclck.graphics.orig = [334,199];
         mfclck.graphics.sz = [40,40];
         mfclck.graphics.flip = true;
-        mfclck.graphics.exprs = exprs;
+        mfclck.graphics.exprs = this.exprs;
         mfclck.graphics.pein = 12;
         mfclck.graphics.peout = [[4],[3]];
         mfclck.model.rpar = 0.1;
@@ -43,7 +43,7 @@ function MCLOCK_f() {
         split2.graphics.orig = [[482.45315],[169.33333]];
         split2.graphics.pein = 5;
         split2.graphics.peout = [[12],[13]];
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MCLOCK_f\",sz(1),sz(2));"]);
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MCLOCK_f\",sz(1),sz(2));"]);
         var diagram = scicos_diagram();
         diagram.objs[1-1] = mfclck;
         diagram.objs[2-1] = clksom;
@@ -61,7 +61,7 @@ function MCLOCK_f() {
         this.x = scicos_block();
         this.x.gui = "MCLOCK_f";
         this.x.graphics.sz = [3,2];
-        this.x.graphics.gr_i = gr_i;
+        this.x.graphics.gr_i = this.gr_i;
         this.x.model.sim = "csuper";
         this.x.model.evtout = [[1],[1]];
         this.x.model.blocktype = "h";
diff --git a/js/Events/MCLOCK_f.pickle b/js/Events/MCLOCK_f.pickle
index cd9a7e13..aba4263b 100644
--- a/js/Events/MCLOCK_f.pickle
+++ b/js/Events/MCLOCK_f.pickle
@@ -2,12 +2,20 @@ c__builtin__
 set
 p0
 ((lp1
-S'x'
+S'exprs'
 p2
-aS'xxn'
+aS'gr_i'
 p3
-atp4
-Rp5
+aS'graphics'
+p4
+aS'x'
+p5
+aS'model'
+p6
+aS'xxn'
+p7
+atp8
+Rp9
 .(dp0
 S'output_port1.graphics.exprs'
 p1
diff --git a/js/Events/MFCLCK_f.js b/js/Events/MFCLCK_f.js
index 322550c3..3836c88e 100644
--- a/js/Events/MFCLCK_f.js
+++ b/js/Events/MFCLCK_f.js
@@ -13,9 +13,9 @@ function MFCLCK_f() {
         this.model.blocktype = new ScilabString(["d"]);
         this.model.firing = new ScilabDouble([-1,0]);
         this.model.dep_ut = new ScilabDouble([false,false]);
-        var exprs = [[string(this.dt)],[string(this.nn)]];
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MFCLCK_f\",sz(1),sz(2));"]);
-        this.x = standard_define([3,2],this.model,exprs,gr_i);
+        this.exprs = [[string(this.dt)],[string(this.nn)]];
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MFCLCK_f\",sz(1),sz(2));"]);
+        this.x = standard_define([3,2],this.model,this.exprs,this.gr_i);
         return new BasicBlock(this.x);
     }
     MFCLCK_f.prototype.details = function MFCLCK_f() {
@@ -31,18 +31,19 @@ function MFCLCK_f() {
     MFCLCK_f.prototype.set = function MFCLCK_f() {
         this.dt = parseFloat(arguments[0]["dt"])
         this.nn = parseFloat(arguments[0]["nn"])
+        this.exprs = arguments[0]["exprs"]
         this.x = arg1;
         this.graphics = arg1.graphics;
-        var exprs = this.graphics.exprs;
+        this.exprs = this.graphics.exprs;
         this.model = arg1.model;
-        [ok,this.dt,this.nn,exprs] = scicos_getvalue("Set Multifrequency clock parameters",["basic period (1/f)","multiply by (n)"],list("vec",1,"vec",1),exprs);
+        [ok,this.dt,this.nn,this.exprs] = scicos_getvalue("Set Multifrequency clock parameters",["basic period (1/f)","multiply by (n)"],list("vec",1,"vec",1),this.exprs);
         if (ok) {
             this.model.ipar = new ScilabDouble([this.nn]);
             this.model.rpar = new ScilabDouble([this.dt]);
             var hh = this.model.firing;
             hh[2-1] = 0;
             this.model.firing = new ScilabDouble(hh);
-            this.graphics.exprs = new ScilabDouble([exprs]);
+            this.graphics.exprs = new ScilabDouble([this.exprs]);
             this.x.graphics = this.graphics;
             this.x.model = this.model;
         }
diff --git a/js/Events/MFCLCK_f.pickle b/js/Events/MFCLCK_f.pickle
index ecb4e072..6ecf6b05 100644
--- a/js/Events/MFCLCK_f.pickle
+++ b/js/Events/MFCLCK_f.pickle
@@ -2,18 +2,22 @@ c__builtin__
 set
 p0
 ((lp1
-S'x'
+S'nn'
 p2
-aS'model'
+aS'exprs'
 p3
-aS'dt'
+aS'gr_i'
 p4
-aS'nn'
-p5
 aS'graphics'
+p5
+aS'x'
 p6
-atp7
-Rp8
+aS'model'
+p7
+aS'dt'
+p8
+atp9
+Rp10
 .(dp0
 S'model.dstate'
 p1
diff --git a/js/Events/M_freq.js b/js/Events/M_freq.js
index ce96787f..36cb2254 100644
--- a/js/Events/M_freq.js
+++ b/js/Events/M_freq.js
@@ -10,9 +10,9 @@ function M_freq() {
         this.model.blocktype = new ScilabString(["d"]);
         this.model.firing = new ScilabDouble([0,-1,-1]);
         this.model.dep_ut = new ScilabDouble([false,false]);
-        var exprs = [[sci2exp([[1],[2]])],[sci2exp([[0],[0]])]];
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"M_freq\",sz(1),sz(2));"]);
-        this.x = standard_define([3,2],this.model,exprs,gr_i);
+        this.exprs = [[sci2exp([[1],[2]])],[sci2exp([[0],[0]])]];
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"M_freq\",sz(1),sz(2));"]);
+        this.x = standard_define([3,2],this.model,this.exprs,this.gr_i);
         return new BasicBlock(this.x);
     }
     M_freq.prototype.details = function M_freq() {
@@ -28,12 +28,13 @@ function M_freq() {
     M_freq.prototype.set = function M_freq() {
         this.frequ = inverse(arguments[0]["frequ"])
         this.offset = inverse(arguments[0]["offset"])
+        this.exprs = arguments[0]["exprs"]
         this.x = arg1;
         this.graphics = arg1.graphics;
         this.model = arg1.model;
-        var exprs = this.graphics.exprs;
+        this.exprs = this.graphics.exprs;
         while (true) {
-            [ok,this.frequ,this.offset,exprs] = scicos_getvalue("Set block parameters",["Sample time","Offset"],list("vec",-1,"vec",-1),exprs);
+            [ok,this.frequ,this.offset,this.exprs] = scicos_getvalue("Set block parameters",["Sample time","Offset"],list("vec",-1,"vec",-1),this.exprs);
             if (!ok) {
                 break;
             }
@@ -74,7 +75,7 @@ function M_freq() {
                     this.graphics.sz = new ScilabDouble([50,40]);
                 }
                 this.model.firing = new ScilabDouble([fir]);
-                this.graphics.exprs = new ScilabDouble([exprs]);
+                this.graphics.exprs = new ScilabDouble([this.exprs]);
                 this.x.graphics = this.graphics;
                 this.x.model = this.model;
                 break;
diff --git a/js/Events/M_freq.pickle b/js/Events/M_freq.pickle
index 806b7dbd..5ef62ea6 100644
--- a/js/Events/M_freq.pickle
+++ b/js/Events/M_freq.pickle
@@ -8,16 +8,20 @@ aS'of'
 p3
 aS'frequ'
 p4
-aS'graphics'
-p5
 aS'offset'
+p5
+aS'exprs'
 p6
-aS'x'
+aS'gr_i'
 p7
-aS'model'
+aS'graphics'
 p8
-atp9
-Rp10
+aS'x'
+p9
+aS'model'
+p10
+atp11
+Rp12
 .(dp0
 S'arg1'
 p1
diff --git a/js/Events/VirtualCLK0.js b/js/Events/VirtualCLK0.js
index b50db6e2..50b68b16 100644
--- a/js/Events/VirtualCLK0.js
+++ b/js/Events/VirtualCLK0.js
@@ -9,8 +9,8 @@ function VirtualCLK0() {
         this.model.blocktype = new ScilabString(["d"]);
         this.model.firing = new ScilabDouble([-1]);
         this.model.dep_ut = new ScilabDouble([false,false]);
-        var exprs = [];
-        this.x = standard_define([2,2],this.model,exprs," ");
+        this.exprs = [];
+        this.x = standard_define([2,2],this.model,this.exprs," ");
         return new BasicBlock(this.x);
     }
     VirtualCLK0.prototype.details = function VirtualCLK0() {
diff --git a/js/Events/VirtualCLK0.pickle b/js/Events/VirtualCLK0.pickle
index 7fd6c99d..11feecbd 100644
--- a/js/Events/VirtualCLK0.pickle
+++ b/js/Events/VirtualCLK0.pickle
@@ -6,8 +6,14 @@ S'x'
 p2
 aS'model'
 p3
-atp4
-Rp5
+aS'gr_i'
+p4
+aS'exprs'
+p5
+aS'graphics'
+p6
+atp7
+Rp8
 .(dp0
 S'model.sim'
 p1
diff --git a/js/Events/freq_div.js b/js/Events/freq_div.js
index 7e3f8b68..d49a8486 100644
--- a/js/Events/freq_div.js
+++ b/js/Events/freq_div.js
@@ -103,8 +103,8 @@ function freq_div() {
         this.model.evtin = new ScilabDouble([1]);
         this.model.evtout = new ScilabDouble([1]);
         this.model.rpar = scs_m_1;
-        var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"freq_div\",sz(1),sz(2));"]);
-        this.x = standard_define([3,2],this.model,[],gr_i);
+        this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"freq_div\",sz(1),sz(2));"]);
+        this.x = standard_define([3,2],this.model,[],this.gr_i);
         return new BasicBlock(this.x);
     }
     freq_div.prototype.details = function freq_div() {
@@ -120,6 +120,7 @@ function freq_div() {
     freq_div.prototype.set = function freq_div() {
         %ph = parseFloat(arguments[0]["%ph"])
         %df = parseFloat(arguments[0]["%df"])
+        this.exprs = inverse(arguments[0]["exprs"])
         for (i=1;i<=length(arg1.model.rpar.objs);i+=1) {
             var o = arg1.model.rpar.objs[i-1];
             if (typeof(o)=="Block"&&o.gui=="Modulo_Count") {
@@ -137,10 +138,10 @@ function freq_div() {
         var xx = arg1[spath-1];
         var xxn = xx;
         this.graphics = xx.graphics;
-        var exprs = this.graphics.exprs;
+        this.exprs = this.graphics.exprs;
         this.model = xx.model;
         while (true) {
-            [ok,%ph,%df,exprs] = scicos_getvalue("Set frequency division block parameters",["Phase (0 to division factor -1)","Division factor"],list("vec",1,"vec",1),exprs);
+            [ok,%ph,%df,this.exprs] = scicos_getvalue("Set frequency division block parameters",["Phase (0 to division factor -1)","Division factor"],list("vec",1,"vec",1),this.exprs);
             if (!ok) {
                 break;
             }
@@ -152,7 +153,7 @@ function freq_div() {
                 if (%ph>%df-1) {
                     %ph = %df-1;
                 }
-                this.graphics.exprs = new ScilabDouble(exprs);
+                this.graphics.exprs = new ScilabDouble(this.exprs);
                 this.model.ipar = new ScilabDouble([%df]);
                 this.model.dstate = new ScilabDouble([%ph]);
                 xxn.graphics = this.graphics;
diff --git a/js/Events/freq_div.pickle b/js/Events/freq_div.pickle
index f58dd424..35055817 100644
--- a/js/Events/freq_div.pickle
+++ b/js/Events/freq_div.pickle
@@ -2,18 +2,22 @@ c__builtin__
 set
 p0
 ((lp1
-S'x'
+S'%df'
 p2
-aS'model'
+aS'exprs'
 p3
-aS'%df'
+aS'gr_i'
 p4
 aS'%ph'
 p5
 aS'graphics'
 p6
-atp7
-Rp8
+aS'x'
+p7
+aS'model'
+p8
+atp9
+Rp10
 .(dp0
 S'lnk.ct'
 p1
-- 
cgit