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
 Problem with loop in Origin2017
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

freefeynman123

Poland
6 Posts

Posted - 05/14/2017 :  3:01:57 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I would like to ask if there's some difference in creating loop in Origin2017. I tried the approach (my function should rename columns):

ncol = wks.ncols; //defines number of columns
for (ii = 2; ii<= ncol; ii +=1) {
wks.col$(ii).name$="b$(ii-1)";
} //renames Y columns like b1, b2 etc.

I always get Command Error, I would appreciate any help.

cpyang

USA
1406 Posts

Posted - 05/14/2017 :  8:57:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This has to do with 2017 intrudced column shortname restriction by default on creating new books. See

http://originlab.com/doc/Origin-Help/Column-Short-Names-Restrict

You can just add

page.XLColName=0;


before your column rename code.

If you need the same code to work on earlier version, then

if(@v>=9.4) page.xlcolname=0;


CP


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