The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 script origin 8.5 not working in OriginPro2015
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

coll@inia.

Spain
125 Posts

Posted - 07/06/2016 :  08:01:55 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.Originpro2015 and Service Release (Select Help-->About Origin):
Operating System:win8

I try to use an older script developed in Oirign8.5 (see below) but got the answer range variable no longer valid...????

Could anyone tell me what do I have to do to make it work?

thanks, julio

//ORDER+OUTLIERS+COPY TO SHEET3
wsort bycol:=1;

//FIRST MEANS & SD
for(nn=2;nn<=9;nn++)
{
for(jj=1; jj<=nRows; jj++)
{
if(col(1)[jj]$==col(1)[jj+1]$)
{kk = kk + 1;}
else
{repes = kk;
ini = jj - repes + 1;
fin = jj;

//mean1 calculation
range gen = col($(nn))[ini:fin];
sum(gen);
range rr1 = col(10)[ini:fin];
rr1 = sum.mean;
range rr2 = col(11)[ini:fin];
rr2 = sum.sd;

kk = 1;
}; // end else if

}; //end for
//type -c first mean & sd;


//OUTLIERS
for(jj=1; jj<=nRows; jj++)
{
dato1=col($(nn))[jj];
dato2=col(10)[jj];
dato3=col(11)[jj];
dato4= dato2+dato3;
dato5=dato2-dato3;
if(dato1>dato4){wcellmask irng:=col($(nn))[jj];};
if(dato1<dato5){wcellmask irng:=col($(nn))[jj];};
}; //end for
//type -c outliers masked!;
//type -c second means and sd will be calculated now;

//SECOND MEANS & SD
for(jj=1; jj<=nRows; jj++)
{
if(col(1)[jj]$==col(1)[jj+1]$)
{kk = kk + 1;}
else
{repes = kk;
ini = jj - repes + 1;
fin = jj;

//mean2 calculation
range gen = col($(nn))[ini:fin];
sum(gen);
range rr1 = col(12)[ini:fin];
rr1 = sum.mean;
range rr2 = col(13)[ini:fin];
rr2 = sum.sd;

kk = 1;
}; // end else if

}; //end for

//type -c second mean & sd calculated!;


colcopy irng:=Sheet2!col(14) orng:=Sheet3!col($(nn));

}

}

page.active=1;
window -a Sheet3;


















Hideo Fujii

USA
1582 Posts

Posted - 07/06/2016 :  3:45:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi coll@inia.,

For me, your code looks okay except the last command:
  window -a Sheet3;
as the window -a command activates the window rather than a sheet.

--Hideo Fujii
OriginLab
Go to Top of Page

coll@inia.

Spain
125 Posts

Posted - 07/07/2016 :  06:23:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you Hideo
I am not capable to make it work again nor in different computers.
Nevertheless, I found out another similar script in another file which works!

Apparently there is nothing essentially different between the scripts: ????
Therefore I am not pursuing that failure further.
I will switch to the other file

Thank you again, julio
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000