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
 String expresssion problem

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
JonasKlim Posted - 12/07/2017 : 09:09:58 AM
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!
2   L A T E S T    R E P L I E S    (Newest First)
JonasKlim Posted - 12/07/2017 : 10:16:00 AM
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
Chris D Posted - 12/07/2017 : 09:42:38 AM
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

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