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 for Programming
 LabTalk Forum
 Interp1 with "Failed to resolve range stri " Error

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
franz_engel Posted - 12/12/2013 : 03:12:12 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.6.0 (64bi)
Operating System: Windows 7

Hi,

I have a couple of "input" Workbooks (in my code i have only the "demo"-Workbook). The names of the workbooks are in an string array. My programm opens a new Workbook and insert a column with values from 580 to 10. The idea is to insert a new column (per input Workbook) into this destination Workbook. The column should be build by the interp1.
My code always raises this failure: "Failed to resolve range string, VarName = iy, VarValue = [demo]1!(Col(1),Col(2))"
Here is my code:
[Main]
string dest$="Auswertung_allPoints";
StringArray src;
src.Add("demo");


newbook sheet:=1 result:=bkn$;
wks.name$=dest$;
page.label$=dest$;
page.longname$=dest$;
range destWks=[dest$]1!;
destWks.col$(1).label$=Y_Equi;
destWks.col$(1).comment$=Equidistante Y Werte;
destWks.col$(1).type=1;
destWks.col$(1).format=1;


for(i=1;i<(5700);i++)
{
	double j=580-(i-1)*0.1;
	%(destWks)Col(1)[i]$=$(j);
};

loop(count,1,src.GetSize())
{
	string srcName$=src.GetAt(count)$;
	range srcWks=[srcName$]1!;
	int nlast=srcWks.nrows;
	for(int ii=nlast;ii>0;ii--)
	{
		%A=%(srcWks)Col(1)[ii]$;
		double aa=%A;
    	if((aa>88.0) || (aa<80.0))
    	{
    		range ra=%(srcWks)[ii];
    		del ra;
    	}
	};

	range iyy=%(srcWks)Col(1);
	range iyx=%(srcWks)Col(2);
	string srcTable$=src.GetAt(1)$;
	
	interp1 ix:=[Auswertung_allPoints]Auswertung_allPoints!Col(1) iy:=(iyy,iyx) ox:=[Auswertung_allPoints]Auswertung_allPoints!Col(2);
};
1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 12/12/2013 : 2:22:20 PM
Your workbook is not named demo. When I run this in a new project:

// BEGIN SCRIPT
col(1)=uniform(100);
col(1)*=14;
col(1)+=78;
col(2)=data(1,100);
win -r %H demo;
string dest$="Auswertung_allPoints";
StringArray src;
src.Add("demo");
newbook sheet:=1 result:=bkn$;
wks.name$=dest$;
page.label$=dest$;
page.longname$=dest$;
range destWks=[dest$]1!;
destWks.col$(1).label$=Y_Equi;
destWks.col$(1).comment$=Equidistante Y Werte;
destWks.col$(1).type=1;
destWks.col$(1).format=1;
for(i=1;i<(5700);i++)
{
double j=580-(i-1)*0.1;
%(destWks)Col(1)[i]$=$(j);
}
loop(count,1,src.GetSize())
{
string srcName$=src.GetAt(count)$;
range srcWks=[srcName$]1!;
int nlast=srcWks.nrows;
for(int ii=nlast;ii>0;ii--)
{
%A=%(srcWks)Col(1)[ii]$;
double aa=%A;
if((aa>88.0) || (aa<80.0))
{
range ra=%(srcWks)[ii];
del ra;
}
}
range iyy=%(srcWks)Col(1);
range iyx=%(srcWks)Col(2);
string srcTable$=src.GetAt(1)$;
interp1 ix:=[Auswertung_allPoints]Auswertung_allPoints!Col(1) iy:=(iyy,iyx) ox:=[Auswertung_allPoints]Auswertung_allPoints!Col(2);
}
// END SCRIPT

the code works. At least, it does 'something' ;-)

But if I comment out the line
win -r %H demo;
then I get the same error you get.
All that line does is rename the Workbook to "demo".

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