summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorSunil Shetye2018-07-18 16:28:24 +0530
committerSunil Shetye2018-07-18 17:07:40 +0530
commit975ae6706b4ac868425193cf25bcbbb268051b5d (patch)
treea08dfa09d5fa0ce9892b3aba84f7420cebc4f532 /js
parent4d1e8bb193a7315a8fcfe1e09c33befdee660b7d (diff)
downloadsci2js-975ae6706b4ac868425193cf25bcbbb268051b5d.tar.gz
sci2js-975ae6706b4ac868425193cf25bcbbb268051b5d.tar.bz2
sci2js-975ae6706b4ac868425193cf25bcbbb268051b5d.zip
handle empty array in comparison
Diffstat (limited to 'js')
-rw-r--r--js/Events/IFTHEL_f.js2
-rw-r--r--js/IntegerOp/LOGIC.js2
-rw-r--r--js/Linear/CLSS.js2
-rw-r--r--js/Linear/CLSS_f.js2
-rw-r--r--js/Linear/DLSS.js2
-rw-r--r--js/Linear/DLSS_f.js2
-rw-r--r--js/Linear/GAINBLK.js2
-rw-r--r--js/Linear/GAINBLK_f.js2
-rw-r--r--js/Linear/GAIN_f.js2
-rw-r--r--js/Linear/TCLSS.js4
-rw-r--r--js/Linear/TCLSS_f.js4
-rw-r--r--js/MatrixOp/MATMUL.js2
-rw-r--r--js/Misc/CBLOCK.js2
-rw-r--r--js/Misc/CBLOCK4.js2
-rw-r--r--js/Misc/DEBUG.js2
-rw-r--r--js/Misc/DSUPER.js2
-rw-r--r--js/Misc/MBLOCK.js2
-rw-r--r--js/Misc/MPBLOCK.js2
-rw-r--r--js/Misc/generic_block.js2
-rw-r--r--js/Misc/generic_block2.js2
-rw-r--r--js/Misc/generic_block3.js2
-rw-r--r--js/NonLinear/LOOKUP_c.js2
-rw-r--r--js/NonLinear/TrigFun.js2
-rw-r--r--js/PDE/PDE.js14
-rw-r--r--js/Sinks/CANIMXY.js4
-rw-r--r--js/Sinks/CANIMXY3D.js4
-rw-r--r--js/Sinks/CEVENTSCOPE.js4
-rw-r--r--js/Sinks/CFSCOPE.js4
-rw-r--r--js/Sinks/CLKOUTV_f.js2
-rw-r--r--js/Sinks/CMSCOPE.js4
-rw-r--r--js/Sinks/CSCOPE.js4
-rw-r--r--js/Sinks/CSCOPXY.js4
-rw-r--r--js/Sinks/CSCOPXY3D.js4
-rw-r--r--js/Sources/CONST_m.js2
-rw-r--r--js/Sources/CURVE_c.js4
-rw-r--r--js/Sources/PULSE_SC.js2
-rw-r--r--js/Sources/READC_f.js4
-rw-r--r--js/Sources/RFILE_f.js4
-rw-r--r--js/Threshold/GENERAL_f.js2
39 files changed, 58 insertions, 58 deletions
diff --git a/js/Events/IFTHEL_f.js b/js/Events/IFTHEL_f.js
index 3a2d4287..30d8eada 100644
--- a/js/Events/IFTHEL_f.js
+++ b/js/Events/IFTHEL_f.js
@@ -30,7 +30,7 @@ function IFTHEL_f() {
}
IFTHEL_f.prototype.set = function IFTHEL_f() {
this.exprs = this.graphics.exprs;
- if (this.exprs==[]) {
+ if (this.exprs.length==0) {
this.exprs = string(1);
}
if (size(this.exprs,"*")==1) {
diff --git a/js/IntegerOp/LOGIC.js b/js/IntegerOp/LOGIC.js
index fe5a24fd..cba94d18 100644
--- a/js/IntegerOp/LOGIC.js
+++ b/js/IntegerOp/LOGIC.js
@@ -45,7 +45,7 @@ function LOGIC() {
if ((u1!=nin)) {
block_parameter_error(msprintf("Wrong size for \'%s\' parameter: %d.","Truth Table",size(this.mat,1)),"Number of rows must be a power of two.");
var ok = false;
- } else if ((find(this.mat.slice()!=0&&this.mat.slice()!=1)!=[])) {
+ } else if ((find(this.mat.slice()!=0&&this.mat.slice()!=1).length!=0)) {
block_parameter_error(msprintf("Wrong value for \'%s\' parameter.","Truth Table"),msprintf("Elements must be in the interval %s.","[0, 1]"));
var ok = false;
} else if (this.herit<0||this.herit>1) {
diff --git a/js/Linear/CLSS.js b/js/Linear/CLSS.js
index 531998b2..5208c088 100644
--- a/js/Linear/CLSS.js
+++ b/js/Linear/CLSS.js
@@ -81,7 +81,7 @@ function CLSS() {
if (ok) {
this.graphics.exprs = new ScilabDouble([this.exprs]);
var rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]];
- if (this.D!=[]) {
+ if (this.D.length!=0) {
if (norm(this.D,1)!=0) {
var mmm = [true,true];
} else {
diff --git a/js/Linear/CLSS_f.js b/js/Linear/CLSS_f.js
index 2e636fd0..74e9dd5b 100644
--- a/js/Linear/CLSS_f.js
+++ b/js/Linear/CLSS_f.js
@@ -71,7 +71,7 @@ function CLSS_f() {
if (ok) {
this.graphics.exprs = new ScilabDouble([this.exprs]);
var rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]];
- if (this.D!=[]) {
+ if (this.D.length!=0) {
if (norm(this.D,1)!=0) {
var mmm = [true,true];
} else {
diff --git a/js/Linear/DLSS.js b/js/Linear/DLSS.js
index b48aafee..e501d355 100644
--- a/js/Linear/DLSS.js
+++ b/js/Linear/DLSS.js
@@ -80,7 +80,7 @@ function DLSS() {
if (ok) {
this.graphics.exprs = new ScilabDouble([this.exprs]);
var rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]];
- if (this.D!=[]) {
+ if (this.D.length!=0) {
if (norm(this.D,1)!=0) {
var mmm = [true,false];
} else {
diff --git a/js/Linear/DLSS_f.js b/js/Linear/DLSS_f.js
index 15da1aa5..45b81b78 100644
--- a/js/Linear/DLSS_f.js
+++ b/js/Linear/DLSS_f.js
@@ -70,7 +70,7 @@ function DLSS_f() {
if (ok) {
this.graphics.exprs = new ScilabDouble([this.exprs]);
var rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]];
- if (this.D!=[]) {
+ if (this.D.length!=0) {
if (norm(this.D,1)!=0) {
var mmm = [true,false];
} else {
diff --git a/js/Linear/GAINBLK.js b/js/Linear/GAINBLK.js
index a70acaf0..4397bb55 100644
--- a/js/Linear/GAINBLK.js
+++ b/js/Linear/GAINBLK.js
@@ -42,7 +42,7 @@ function GAINBLK() {
if (!ok) {
break;
}
- if (this.gain==[]) {
+ if (this.gain.length==0) {
message("Gain must have at least one element");
throw "user error";
} else {
diff --git a/js/Linear/GAINBLK_f.js b/js/Linear/GAINBLK_f.js
index 5003f542..93dced8d 100644
--- a/js/Linear/GAINBLK_f.js
+++ b/js/Linear/GAINBLK_f.js
@@ -33,7 +33,7 @@ function GAINBLK_f() {
if (!ok) {
break;
}
- if (this.gain==[]) {
+ if (this.gain.length==0) {
message("Gain must have at least one element");
throw "user error";
} else {
diff --git a/js/Linear/GAIN_f.js b/js/Linear/GAIN_f.js
index 201a47a2..c9a8aaed 100644
--- a/js/Linear/GAIN_f.js
+++ b/js/Linear/GAIN_f.js
@@ -33,7 +33,7 @@ function GAIN_f() {
if (!ok) {
break;
}
- if (this.gain==[]) {
+ if (this.gain.length==0) {
message("Gain must have at least one element");
throw "user error";
} else {
diff --git a/js/Linear/TCLSS.js b/js/Linear/TCLSS.js
index 391f5387..73f319ae 100644
--- a/js/Linear/TCLSS.js
+++ b/js/Linear/TCLSS.js
@@ -73,7 +73,7 @@ function TCLSS() {
if (ok) {
this.graphics.exprs = new ScilabDouble([this.exprs]);
var rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]];
- if (this.D!=[]) {
+ if (this.D.length!=0) {
if (norm(this.D,1)!=0) {
var mmm = [true,true];
} else {
@@ -87,7 +87,7 @@ function TCLSS() {
}
this.model.state = new ScilabDouble(this.x0.slice());
this.model.rpar = new ScilabDouble(rpar);
- if (this.D!=[]) {
+ if (this.D.length!=0) {
this.model.sim = list(new ScilabString(["tcslti4"]), new ScilabDouble([4]));
} else {
this.model.sim = list(new ScilabString(["tcsltj4"]), new ScilabDouble([4]));
diff --git a/js/Linear/TCLSS_f.js b/js/Linear/TCLSS_f.js
index c9f91609..3003cbcd 100644
--- a/js/Linear/TCLSS_f.js
+++ b/js/Linear/TCLSS_f.js
@@ -73,7 +73,7 @@ function TCLSS_f() {
if (ok) {
this.graphics.exprs = new ScilabDouble([this.exprs]);
var rpar = [[this.A.slice()],[this.B.slice()],[this.C.slice()],[this.D.slice()]];
- if (this.D!=[]) {
+ if (this.D.length!=0) {
if (norm(this.D,1)!=0) {
var mmm = [true,true];
} else {
@@ -87,7 +87,7 @@ function TCLSS_f() {
}
this.model.state = new ScilabDouble(this.x0.slice());
this.model.rpar = new ScilabDouble(rpar);
- if (this.D!=[]) {
+ if (this.D.length!=0) {
this.model.sim = list(new ScilabString(["tcslti"]), new ScilabDouble([1]));
} else {
this.model.sim = list(new ScilabString(["tcsltj"]), new ScilabDouble([1]));
diff --git a/js/MatrixOp/MATMUL.js b/js/MatrixOp/MATMUL.js
index e85ee09e..1766bd00 100644
--- a/js/MatrixOp/MATMUL.js
+++ b/js/MatrixOp/MATMUL.js
@@ -29,7 +29,7 @@ function MATMUL() {
this.graphics = this.x.graphics;
var label = this.graphics.exprs;
this.model = this.x.model;
- if (this.model.ipar==[]) {
+ if (this.model.ipar.length==0) {
this.model.ipar = new ScilabDouble([1]);
}
if (size(label,"*")==1) {
diff --git a/js/Misc/CBLOCK.js b/js/Misc/CBLOCK.js
index 91cec33f..1d9bfc55 100644
--- a/js/Misc/CBLOCK.js
+++ b/js/Misc/CBLOCK.js
@@ -96,7 +96,7 @@ function CBLOCK() {
} else {
var funtyp = 2004;
}
- if ([[this.ci],[this.co]]!=[]) {
+ if ([[this.ci],[this.co]].length!=0) {
if (max([[this.ci],[this.co]])>1) {
message("vector event links not supported");
throw "user error";
diff --git a/js/Misc/CBLOCK4.js b/js/Misc/CBLOCK4.js
index 247ef9b2..128533b0 100644
--- a/js/Misc/CBLOCK4.js
+++ b/js/Misc/CBLOCK4.js
@@ -87,7 +87,7 @@ function CBLOCK4() {
} else {
var funtyp = 2004;
}
- if ([[this.ci],[this.co]]!=[]) {
+ if ([[this.ci],[this.co]].length!=0) {
if (max([[this.ci],[this.co]])>1) {
message("vector event links not supported");
throw "user error";
diff --git a/js/Misc/DEBUG.js b/js/Misc/DEBUG.js
index e16c4c3d..3be54709 100644
--- a/js/Misc/DEBUG.js
+++ b/js/Misc/DEBUG.js
@@ -22,7 +22,7 @@ function DEBUG() {
while (1==1) {
var tmpvar0 = dialog([["Enter scilab instructions for debugging."],[" Inputs are block and flag, output is block"]],textmp);
var txt = tmpvar0[0];
- if (txt!=[]) {
+ if (txt.length!=0) {
var tt = ["block=debug_scicos(block,flag)"];
if (execstr("deff(tt,txt)","errcatch")==0) {
var warnMode = warning("query");
diff --git a/js/Misc/DSUPER.js b/js/Misc/DSUPER.js
index aefaa9fa..96fc3fc9 100644
--- a/js/Misc/DSUPER.js
+++ b/js/Misc/DSUPER.js
@@ -19,7 +19,7 @@ function DSUPER() {
var exprs0 = this.graphics.exprs[2-1][1-1];
var btitre = this.graphics.exprs[2-1][2-1][1-1];
var bitems = this.graphics.exprs[2-1][2-1].slice(2-1,$);
- if (exprs0==[]) {
+ if (exprs0.length==0) {
return;
}
var tmpvar0 = script2var(context,PREVAR_scicos_context);
diff --git a/js/Misc/MBLOCK.js b/js/Misc/MBLOCK.js
index 456a536a..06504708 100644
--- a/js/Misc/MBLOCK.js
+++ b/js/Misc/MBLOCK.js
@@ -233,7 +233,7 @@ function MBLOCK() {
}
}
if (ok) {
- if (extF==".mo"&&fileinfo(this.funam)!=[]) {
+ if (extF==".mo"&&fileinfo(this.funam).length!=0) {
var tt = mgetl(this.funam);
} else {
var tt = this.exprs.funtxt;
diff --git a/js/Misc/MPBLOCK.js b/js/Misc/MPBLOCK.js
index 97a9a895..f20e0135 100644
--- a/js/Misc/MPBLOCK.js
+++ b/js/Misc/MPBLOCK.js
@@ -234,7 +234,7 @@ function MPBLOCK() {
mo.model = nameF;
mo.inputs = this.in1;
mo.outputs = this.out;
- if (pprop!=[]) {
+ if (pprop.length!=0) {
if (max(pprop)>0) {
mo.parameters = list(transpose(param),paramv,transpose(pprop));
} else {
diff --git a/js/Misc/generic_block.js b/js/Misc/generic_block.js
index cfe26859..12e9bfcf 100644
--- a/js/Misc/generic_block.js
+++ b/js/Misc/generic_block.js
@@ -82,7 +82,7 @@ function generic_block() {
throw "user error";
var ok = false;
}
- if ([[this.ci],[this.co]]!=[]) {
+ if ([[this.ci],[this.co]].length!=0) {
if (max([[this.ci],[this.co]])>1) {
message("vector event links not supported");
throw "user error";
diff --git a/js/Misc/generic_block2.js b/js/Misc/generic_block2.js
index dd85d849..91a33aab 100644
--- a/js/Misc/generic_block2.js
+++ b/js/Misc/generic_block2.js
@@ -86,7 +86,7 @@ function generic_block2() {
throw "user error";
var ok = false;
}
- if ([[this.ci],[this.co]]!=[]) {
+ if ([[this.ci],[this.co]].length!=0) {
if (max([[this.ci],[this.co]])>1) {
message("vector event links not supported");
throw "user error";
diff --git a/js/Misc/generic_block3.js b/js/Misc/generic_block3.js
index 4c5814ec..68ea054a 100644
--- a/js/Misc/generic_block3.js
+++ b/js/Misc/generic_block3.js
@@ -88,7 +88,7 @@ function generic_block3() {
throw "user error";
var ok = false;
}
- if ([[this.ci],[this.co]]!=[]) {
+ if ([[this.ci],[this.co]].length!=0) {
if (max([[this.ci],[this.co]])>1) {
message("vector event links not supported");
throw "user error";
diff --git a/js/NonLinear/LOOKUP_c.js b/js/NonLinear/LOOKUP_c.js
index c31dddf6..3dcaacb9 100644
--- a/js/NonLinear/LOOKUP_c.js
+++ b/js/NonLinear/LOOKUP_c.js
@@ -160,7 +160,7 @@ function LOOKUP_c() {
}
if ((SaveExit)) {
var xp = find(orpar.slice(1-1,oipar[1-1])>=0);
- if ((xp!=[])) {
+ if ((xp.length!=0)) {
this.model.firing = new ScilabDouble([orpar[xp[1-1]-1]]);
} else {
this.model.firing = new ScilabDouble([-1]);
diff --git a/js/NonLinear/TrigFun.js b/js/NonLinear/TrigFun.js
index 97b73bf3..776e2309 100644
--- a/js/NonLinear/TrigFun.js
+++ b/js/NonLinear/TrigFun.js
@@ -28,7 +28,7 @@ function TrigFun() {
if (!ok) {
break;
}
- if (find(PREVAR_FF==this.fun)==[]) {
+ if (find(PREVAR_FF==this.fun).length==0) {
message("Sorry but "+this.fun+" is not in the list!");
throw "user error";
} else {
diff --git a/js/PDE/PDE.js b/js/PDE/PDE.js
index d396f0fa..bda86d3a 100644
--- a/js/PDE/PDE.js
+++ b/js/PDE/PDE.js
@@ -127,7 +127,7 @@ function PDE() {
var ind4 = strindex(a4,"x");
var ind1 = strindex(a1,"x");
var ind2 = strindex(a2,"x");
- if ((ind4!=[]||ind1!=[]||ind2!=[])) {
+ if ((ind4.length!=0||ind1.length!=0||ind2.length!=0)) {
if ((signe==1)) {
var delta = 1;
} else if ((signe==2)) {
@@ -141,7 +141,7 @@ function PDE() {
} else {
var delta = evstr(a4)^2-4*evstr(a1)*evstr(a2);
}
- if ((delta==[])) {
+ if ((delta.length==0)) {
var delta = 0;
}
var type_meth = arbre_decision(delta);
@@ -155,22 +155,22 @@ function PDE() {
if (((CLa_type==1)&&(DF_type==0||DF_type==1))||((CLb_type==1)&&(DF_type==0||DF_type==2))) {
var Nbr = Nbr+1;
}
- if ((mesures==[])) {
+ if ((mesures.length==0)) {
var out = Nbr_maillage;
} else {
var out = [[Nbr_maillage],[size(mesures,"*")]];
}
if ((flag_type==1)) {
this.model.sim = list(new ScilabDouble([this.rdnom]), new ScilabDouble([2004]));
- if ((find(oper==1)!=[])) {
+ if ((find(oper==1).length!=0)) {
this.model.state = new ScilabDouble([zeros(2*Nbr_maillage,1)]);
} else {
this.model.state = new ScilabDouble([zeros(Nbr_maillage,1)]);
}
} else if ((flag_type==2)) {
this.model.sim = list(new ScilabDouble([this.rdnom]), new ScilabDouble([12004]));
- if ((find(oper==1)!=[])) {
- if ((type_meth==3&&(find(oper==2)!=[]||find(oper==4)!=[]))) {
+ if ((find(oper==1).length!=0)) {
+ if ((type_meth==3&&(find(oper==2).length!=0||find(oper==4).length!=0))) {
this.model.state = new ScilabDouble([zeros(6*Nbr_maillage,1)]);
} else if ((type_meth==1)) {
this.model.state = new ScilabDouble([zeros(4*Nbr,1)]);
@@ -178,7 +178,7 @@ function PDE() {
this.model.state = new ScilabDouble([zeros(4*Nbr_maillage,1)]);
}
} else {
- if ((type_meth==3&&(find(oper==2)!=[]||find(oper==4)!=[]))) {
+ if ((type_meth==3&&(find(oper==2).length!=0||find(oper==4).length!=0))) {
this.model.state = new ScilabDouble([zeros(4*Nbr_maillage,1)]);
} else if ((type_meth==1)) {
this.model.state = new ScilabDouble([zeros(2*Nbr,1)]);
diff --git a/js/Sinks/CANIMXY.js b/js/Sinks/CANIMXY.js
index 751536ff..b98165fe 100644
--- a/js/Sinks/CANIMXY.js
+++ b/js/Sinks/CANIMXY.js
@@ -108,10 +108,10 @@ function CANIMXY() {
this.model = tmpvar0[0];
this.graphics = tmpvar0[1];
var ok = tmpvar0[2];
- if (this.wpos==[]) {
+ if (this.wpos.length==0) {
this.wpos = [[-1],[-1]];
}
- if (this.wdim==[]) {
+ if (this.wdim.length==0) {
this.wdim = [[-1],[-1]];
}
var rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]];
diff --git a/js/Sinks/CANIMXY3D.js b/js/Sinks/CANIMXY3D.js
index 28eaf761..9ff328e5 100644
--- a/js/Sinks/CANIMXY3D.js
+++ b/js/Sinks/CANIMXY3D.js
@@ -124,10 +124,10 @@ function CANIMXY3D() {
this.model = tmpvar0[0];
this.graphics = tmpvar0[1];
var ok = tmpvar0[2];
- if (this.wpos==[]) {
+ if (this.wpos.length==0) {
this.wpos = [[-1],[-1]];
}
- if (this.wdim==[]) {
+ if (this.wdim.length==0) {
this.wdim = [[-1],[-1]];
}
var rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]];
diff --git a/js/Sinks/CEVENTSCOPE.js b/js/Sinks/CEVENTSCOPE.js
index 44261885..13e18eb5 100644
--- a/js/Sinks/CEVENTSCOPE.js
+++ b/js/Sinks/CEVENTSCOPE.js
@@ -84,10 +84,10 @@ function CEVENTSCOPE() {
throw "user error";
}
if (ok) {
- if (this.wpos==[]) {
+ if (this.wpos.length==0) {
this.wpos = [[-1],[-1]];
}
- if (this.wdim==[]) {
+ if (this.wdim.length==0) {
this.wdim = [[-1],[-1]];
}
var rpar = this.per;
diff --git a/js/Sinks/CFSCOPE.js b/js/Sinks/CFSCOPE.js
index 57294d55..928fb538 100644
--- a/js/Sinks/CFSCOPE.js
+++ b/js/Sinks/CFSCOPE.js
@@ -88,10 +88,10 @@ function CFSCOPE() {
throw "user error";
}
if (ok) {
- if (this.wpos==[]) {
+ if (this.wpos.length==0) {
this.wpos = [[-1],[-1]];
}
- if (this.wdim==[]) {
+ if (this.wdim.length==0) {
this.wdim = [[-1],[-1]];
}
var rpar = [[0],[this.ymin],[this.ymax],[this.per]];
diff --git a/js/Sinks/CLKOUTV_f.js b/js/Sinks/CLKOUTV_f.js
index bcebcaee..08e77e1f 100644
--- a/js/Sinks/CLKOUTV_f.js
+++ b/js/Sinks/CLKOUTV_f.js
@@ -82,7 +82,7 @@ function CLKOUTV_f() {
xfpoly(in1.slice()[1-1]+ones(4,1)*(orig[1-1]+sz[1-1]/2),in1.slice()[2-1]+ones(4,1)*(orig[2-1]+sz[2-1]),1);
xset("thickness",thick);
xset("pattern",pat);
- if (ident!=[]&&ident!="") {
+ if (ident.length!=0&&ident!="") {
var font = xget("font");
xset("font",this.options.ID[1-1][1-1],this.options.ID[1-1][2-1]);
var rectangle = xstringl(orig[1-1],orig[2-1],ident);
diff --git a/js/Sinks/CMSCOPE.js b/js/Sinks/CMSCOPE.js
index 97e72111..20969d00 100644
--- a/js/Sinks/CMSCOPE.js
+++ b/js/Sinks/CMSCOPE.js
@@ -125,10 +125,10 @@ function CMSCOPE() {
var ok = tmpvar0[2];
}
if (ok) {
- if (this.wpos==[]) {
+ if (this.wpos.length==0) {
this.wpos = [[-1],[-1]];
}
- if (this.wdim==[]) {
+ if (this.wdim.length==0) {
this.wdim = [[-1],[-1]];
}
if (ok) {
diff --git a/js/Sinks/CSCOPE.js b/js/Sinks/CSCOPE.js
index 2ffc3747..5b12e2ea 100644
--- a/js/Sinks/CSCOPE.js
+++ b/js/Sinks/CSCOPE.js
@@ -98,10 +98,10 @@ function CSCOPE() {
var ok = tmpvar0[2];
}
if (ok) {
- if (this.wpos==[]) {
+ if (this.wpos.length==0) {
this.wpos = [[-1],[-1]];
}
- if (this.wdim==[]) {
+ if (this.wdim.length==0) {
this.wdim = [[-1],[-1]];
}
var rpar = [[0],[this.ymin],[this.ymax],[this.per]];
diff --git a/js/Sinks/CSCOPXY.js b/js/Sinks/CSCOPXY.js
index ae81af95..dc49319e 100644
--- a/js/Sinks/CSCOPXY.js
+++ b/js/Sinks/CSCOPXY.js
@@ -107,10 +107,10 @@ function CSCOPXY() {
this.model = tmpvar0[0];
this.graphics = tmpvar0[1];
var ok = tmpvar0[2];
- if (this.wpos==[]) {
+ if (this.wpos.length==0) {
this.wpos = [[-1],[-1]];
}
- if (this.wdim==[]) {
+ if (this.wdim.length==0) {
this.wdim = [[-1],[-1]];
}
var rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]];
diff --git a/js/Sinks/CSCOPXY3D.js b/js/Sinks/CSCOPXY3D.js
index a988d1aa..9b25962a 100644
--- a/js/Sinks/CSCOPXY3D.js
+++ b/js/Sinks/CSCOPXY3D.js
@@ -116,10 +116,10 @@ function CSCOPXY3D() {
this.model = tmpvar0[0];
this.graphics = tmpvar0[1];
var ok = tmpvar0[2];
- if (this.wpos==[]) {
+ if (this.wpos.length==0) {
this.wpos = [[-1],[-1]];
}
- if (this.wdim==[]) {
+ if (this.wdim.length==0) {
this.wdim = [[-1],[-1]];
}
var rpar = [[this.vec_x.slice()],[this.vec_y.slice()],[this.vec_z.slice()],[this.param3ds.slice()]];
diff --git a/js/Sources/CONST_m.js b/js/Sources/CONST_m.js
index f0dc3885..7cc3cd7f 100644
--- a/js/Sources/CONST_m.js
+++ b/js/Sources/CONST_m.js
@@ -32,7 +32,7 @@ function CONST_m() {
break;
}
var nout = size(this.C);
- if (find(nout==0)!=[]) {
+ if (find(nout==0).length!=0) {
block_parameter_error(msprintf("Wrong size for \'%s\' parameter","Constant Value"),"Constant value must have at least one element.");
} else {
this.model.sim = list(new ScilabString(["cstblk4_m"]), new ScilabDouble([4]));
diff --git a/js/Sources/CURVE_c.js b/js/Sources/CURVE_c.js
index 77f72cc0..46004f4e 100644
--- a/js/Sources/CURVE_c.js
+++ b/js/Sources/CURVE_c.js
@@ -88,7 +88,7 @@ function CURVE_c() {
if (this.graf=="y"||this.graf=="Y") {
var ipar = [[N],[mtd],[PO]];
var rpar = [];
- if ((winsid()==[])) {
+ if ((winsid().length==0)) {
this.curwin = 0;
} else {
this.curwin = max(winsid())+1;
@@ -148,7 +148,7 @@ function CURVE_c() {
}
if ((SaveExit)) {
var xp = find(orpar.slice(1-1,oipar[1-1])>=0);
- if ((xp!=[])) {
+ if ((xp.length!=0)) {
this.model.firing = new ScilabDouble([orpar[xp[1-1]-1]]);
} else {
this.model.firing = new ScilabDouble([-1]);
diff --git a/js/Sources/PULSE_SC.js b/js/Sources/PULSE_SC.js
index 8a70dd1a..e6976819 100644
--- a/js/Sources/PULSE_SC.js
+++ b/js/Sources/PULSE_SC.js
@@ -88,7 +88,7 @@ function PULSE_SC() {
break;
}
} else {
- if ((lasterror()!=[])) {
+ if ((lasterror().length!=0)) {
messagebox(lasterror());
}
var ok = false;
diff --git a/js/Sources/READC_f.js b/js/Sources/READC_f.js
index a73d42f7..1c079a7f 100644
--- a/js/Sources/READC_f.js
+++ b/js/Sources/READC_f.js
@@ -87,7 +87,7 @@ function READC_f() {
block_parameter_error(msprintf("Wrong value for \'%s\' parameter.","Input File Name"),"You must provide a file name.");
} else if (this.M<1) {
block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Record Size",this.M),"Strictly positive integer expected.");
- } else if (this.tmask1!=[]&&(this.tmask1<1||this.tmask1>this.M)) {
+ } else if (this.tmask1.length!=0&&(this.tmask1<1||this.tmask1>this.M)) {
block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Time Record Selection",this.tmask1),msprintf("Must be in the interval %s.","[1, Record Size = "+string(this.M)+"]"));
} else if (nout==0) {
block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Outputs Record Selection",nout),"Strictly positive integer expected.");
@@ -102,7 +102,7 @@ function READC_f() {
} else if (this.offset<1) {
block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Initial Record Index",this.offset),"Strictly positive integer expected.");
} else {
- if (this.tmask1==[]) {
+ if (this.tmask1.length==0) {
var ievt = 0;
this.tmask1 = 0;
var outpt = [];
diff --git a/js/Sources/RFILE_f.js b/js/Sources/RFILE_f.js
index 8c3ce1b7..d0e2060a 100644
--- a/js/Sources/RFILE_f.js
+++ b/js/Sources/RFILE_f.js
@@ -67,7 +67,7 @@ function RFILE_f() {
var nout = size(this.outmask,"*");
if (prod(size(this.tmask1))>1) {
block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %s.","Time Record Selection",strcat(string(this.tmask1.slice())," ")),"Empty matrix or scalar expected.");
- } else if (this.tmask1!=[]&&this.tmask1<1) {
+ } else if (this.tmask1.length!=0&&this.tmask1<1) {
block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d","Time Record Selection",this.tmask1),"Strictly positive integer expected.");
} else if (lunit>0&&min(length(frmt),1)!=min(length(this.frmt1),1)) {
block_parameter_error(["Simulation running !!! You cannot switch <br />between formatted and unformatted"],"End current simulation first.");
@@ -86,7 +86,7 @@ function RFILE_f() {
} else if (min(this.outmask)<1) {
block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %s","Outputs Record Selection",strcat(string(this.outmask.slice())," ")),"Strictly positive indexes expected.");
} else {
- if (this.tmask1==[]) {
+ if (this.tmask1.length==0) {
var ievt = 0;
var cout = [];
this.tmask1 = 0;
diff --git a/js/Threshold/GENERAL_f.js b/js/Threshold/GENERAL_f.js
index 6e956ffe..3c897775 100644
--- a/js/Threshold/GENERAL_f.js
+++ b/js/Threshold/GENERAL_f.js
@@ -53,7 +53,7 @@ function GENERAL_f() {
}
var n = size(rp,2)/2;
var result = x_mdialog("routing matrix",string(1,nout1),string(1,2^(2*nin1)),string(rp.slice().slice()));
- if (result!=[]) {
+ if (result.length!=0) {
rp.slice(1-1,nout1).slice(1-1,2*n) = evstr(result);
this.model.nzcross = new ScilabDouble([this.in1]);
this.model.rpar = new ScilabDouble(rp.slice());