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
 All Forums
 Origin Forum
 Origin Forum
 Undefined variable

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Duff Posted - 02/07/2018 : 08:21:44 AM
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)


2   L A T E S T    R E P L I E S    (Newest First)
Duff Posted - 02/08/2018 : 09:35:11 AM
Thank you, these variables had not been declared.
Echo_Chu Posted - 02/08/2018 : 04:23:41 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000