I'm probably overtired and doing something silly but can anyone tell me why ...
TestA.efs works ok
TestB.efs doesn't
on eSignal Version 10.6.2415.1208
TestA.efs works ok
TestB.efs doesn't
on eSignal Version 10.6.2415.1208
if (bInit == false)
{
bInit = true;
db("testB1");
debugPrintln("21: bInit = "+bInit);
db("testB2",getValue("year",-2));
debugPrintln("22: bInit = "+bInit);
db("testB3",getYear(-2));
debugPrintln("23: bInit = "+bInit);
}
}
//returns the following:
//21: bInit = true
//12 20 14 36 testB1 undefined undefined undefined
if (bInit == false)
{
db("testB1");
bInit = true;
debugPrintln("21: bInit = "+bInit);
db("testB2",getValue("year",-2));
debugPrintln("22: bInit = "+bInit);
db("testB3",getYear(-2));
debugPrintln("23: bInit = "+bInit);
}
}
//returns the following:
//21: bInit = true
//12 20 14 36 testB1 undefined undefined undefined
if (bInit == false)
{
db("testB1");
debugPrintln("21: bInit = "+bInit);
bInit = true;
db("testB2",getValue("year",-2));
debugPrintln("22: bInit = "+bInit);
db("testB3",getYear(-2));
debugPrintln("23: bInit = "+bInit);
}
}
//returns the following:
//21: bInit = false
//12 20 14 36 testB1 undefined undefined undefined
if (bInit == false)
{
db("testB1");
debugPrintln("21: bInit = "+bInit);
db("testB2",getValue("year",-2));
bInit = true;
debugPrintln("22: bInit = "+bInit);
db("testB3",getYear(-2));
debugPrintln("23: bInit = "+bInit);
}
}
//returns the following:
//23: bInit = true
//12 20 14 39 testB3 2012 undefined undefined
//22: bInit = true
//12 20 14 39 testB2 2012 undefined undefined
//21: bInit = false
//12 20 14 39 testB1 undefined undefined undefined
//21: bInit = false
//12 20 14 36 testB1 undefined undefined undefined
if (bInit == false)
{
bInit = true;
db("testB1");
debugPrintln("21: bInit = "+bInit);
// bInit = true;
//db("testB2",getValue("year",-2));
// bInit = true;
debugPrintln("22: bInit = "+bInit);
// db("testB3",getYear(-2));
debugPrintln("23: bInit = "+bInit);
}
//returns the following:
//23: bInit = true
//22: bInit = true
//21: bInit = true
//12 20 16 9 testB1 undefined undefined undefined
function preMain() {
setPriceStudy(true);
setStudyTitle("www.futurenets.co.uk TestC eSignal Version 10.6.2415.1208");
}
var bInit = false;
var Flag = 0;
function main()
{
if (getBarState() == BARSTATE_ALLBARS)
{
var OldestBar = getOldestBarIndex();
OldestBar *= -1; //OldestBar is now +ve
db("testC1",OldestBar);
db("testC2",getValue("rawtime",OldestBar));
db("testC3",getValue("year",OldestBar));
debugPrintln();
}
if(getCurrentBarIndex()==0 && getBarState()== BARSTATE_NEWBAR){
if(Flag!=1){
var OldestBar1 = getOldestBarIndex();
OldestBar1 *= -1; //OldestBar1 is now +ve
db("testC4",OldestBar1);
db("testC5",OldestBar1,getValue("rawtime",OldestBar1));
db("testC6",OldestBar1,getValue("year",OldestBar1));
Flag=1;
}
}
return null;
}
function db(a,b,c,d) {
debugPrintln(a + "\t1: "+getMonth() + " " + getDay() + " " + getHour() + " " + getMinute() + " " + b + " " + c + " " + d+"\t"+getCurrentBarCount());
if(a != "testC1" && a != "testC2" && a != "testC3"){
debugPrintln("\n"+a + "\t2: "+getMonth(-b) + " " + getDay(-b) + " " + getHour(-b) + " " + getMinute(-b) + " " + b + " " + c + " " + d+"\t"+getCurrentBarCount());
}
}
/*
returns:
testC6 2: 12 20 16 57 313 null undefined 314
testC6 1: 12 21 9 21 313 null undefined 314
testC5 2: 12 20 16 57 313 null undefined 314
testC5 1: 12 21 9 21 313 null undefined 314
testC4 2: 12 20 16 57 313 undefined undefined 314
testC4 1: 12 21 9 21 313 undefined undefined 314
testC3 1: 12 20 16 57 2012 undefined undefined 1
testC2 1: 12 20 16 57 1356099660 undefined undefined 1
testC1 1: 12 20 16 57 313 undefined undefined 1
*/
Comment