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
 String expresssion problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

JonasKlim

Lithuania
36 Posts

Posted - 12/07/2017 :  09:09:58 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin Student 2018
Operating System: Win10

Hello,
I am writing script for automatic plotting of graphs. The script runs through summary table and looks for lines where name of graph is written (col "G" or "7"). If cell is empty script goes to next cell. Everything works fine until first name (MVvsB)is found, assigned to grname$ and graph is plotted. Then, regardless if next name cell is empty of full, the "str expression error" is generated.
It looks like the problem is caused by the program jumping to plot data table while performing "plotxy iy:=" function.

Please see the script and log below. What work-around I could use?
Best regards,

Jonas

string grname$= "";
string bkname$= "";
string lent$= "";
int nn=0;
//run through summary table with 72 lines//;
for(ii=1; ii<=72; ii++)
{;
ii=;
grname$= col(7)[ii]$; //get name for chart//;
//grname$=;

nn= Len(grname$);
if (nn!=0)
{;
lent$= col(5)[ii]$; //get name of data worksheet//;
//lent$=;
bkname$=col(6)[ii]$;// get name for data book//;
plotxy iy:=[bkname$]lent$!(1,9) plot:=200; //plot graph//;
grname$=;
//string grname$= "";
//nn=;
};
};

ii=1
ii=2
ii=3
ii=4
ii=5
ii=6
ii=7
ii=8
ii=9
ii=10
ii=11
ii=12
ii=13
ii=14
ii=15
ii=16
ii=17
ii=18
ii=19
MVvsB
ii=20
col(7)[ii]$: str expression error
col(5)[ii]$: str expression error
col(6)[ii]$: str expression error
Failed to resolve range string, VarName = iy, VarValue = [bkname$]lent$!(1,9)
#Command Error!

Edited by - JonasKlim on 12/07/2017 09:17:31 AM

Chris D

428 Posts

Posted - 12/07/2017 :  09:42:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Try removing the semicolons after {. So:

{; should be just {


Also semicolons after } are not required.

Does this help?


Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

JonasKlim

Lithuania
36 Posts

Posted - 12/07/2017 :  10:16:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Chris,

I have found a solution - to activate the sheet on which the loop was started:

win -a Book1;// activate book;
page.active$ ="AL2O3"; //Active worksheet by name;

Now the script works OK.

Best regards,

Jonas

Edited by - JonasKlim on 12/07/2017 1:42:06 PM
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