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
 Origin Forum
 Undefined variable
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Duff

Argentina
42 Posts

Posted - 02/07/2018 :  08:21:44 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Originpro 2017 sr2
Operating System: Win7 64
I have a code that I don't know why it doesn't work.
It tells me undefined variable.
get Col(BDHE) -e numpoints; //count of rows in Col(BDHE)
range aaa=[Book]Sheet!Col(BDHE); //variable aaa with [Book]Sheet!Col(BDHE) values
For (ii=1; ii<=numpoints; ii++)
{
	if aaa[ii]<(Mean(aaa)+StdDev(aaa))
		aab[ii]=aaa[ii]; //using variable aab
	else
		aab[ii]="";	 // cell ii of variable aab empty
		if aab[ii]<(Mean(aab)+StdDev(aab))
			aac[ii]=aab[ii]; // using variable aac
		else
			aac[ii]="";
            if aac[ii]<(Mean(aac)+StdDev(aac))
				aad[ii]=aac[ii]; // using variable aad
			else
				aad[ii]="";
}
Col(Corte)[1]=Mean(aad)+2*StdDev(aad); // fill row 1 of Col(Corte)
Col(Corte)[2]=Mean(aad)+4*StdDev(aad); // fill row 2 of Col(Corte)
Col(Corte)[3]=Mean(aad)+6*StdDev(aad); // fill row 3 of Col(Corte)
Col(Corte)[4]=Mean(aad)+8*StdDev(aad); // fill row 4 of Col(Corte)


Echo_Chu

China
Posts

Posted - 02/08/2018 :  04:23:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You should define aad first for using it. Please try scripts below

dataset aad;
get Col(BDHE) -e numpoints; //count of rows in Col(BDHE)
range aaa=[Book]Sheet!Col(BDHE); //variable aaa with [Book]Sheet!Col(BDHE) values
For (ii=1; ii<=numpoints; ii++)
{
	if aaa[ii]<(Mean(aaa)+StdDev(aaa))
		aab[ii]=aaa[ii]; //using variable aab
	else
		aab[ii]="";	 // cell ii of variable aab empty
		if aab[ii]<(Mean(aab)+StdDev(aab))
			aac[ii]=aab[ii]; // using variable aac
		else
			aac[ii]="";
            if aac[ii]<(Mean(aac)+StdDev(aac))
				aad[ii]=aac[ii]; // using variable aad
			else
				aad[ii]="";
}
Col(Corte)[1]=Mean(aad)+2*StdDev(aad); // fill row 1 of Col(Corte)
Col(Corte)[2]=Mean(aad)+4*StdDev(aad); // fill row 2 of Col(Corte)
Col(Corte)[3]=Mean(aad)+6*StdDev(aad); // fill row 3 of Col(Corte)
Col(Corte)[4]=Mean(aad)+8*StdDev(aad); // fill row 4 of Col(Corte)


Echo
OriginLab Technical Support
Go to Top of Page

Duff

Argentina
42 Posts

Posted - 02/08/2018 :  09:35:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you, these variables had not been declared.
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