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 for Programming
 LabTalk Forum
 initializing range
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

juggernick

USA
1 Posts

Posted - 06/08/2012 :  4:37:20 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: 8.5.0 SR0
Operating System: Windows 7

Hi,

I am trying to trim some excess data of all of the workbooks in a folder. The following script works if I run it on an individual workbook, but if I include the "doc -ef W" to make it run on all of them, it does not. I've found that this is because "range aa = [%H]1!1;" does not update with each iteration (it's always the value of the first workbook processed). Additionally, the assignment "range temps = aa[1:50];" fills temps with the same incorrect values as aa, but the calculation "fixTemp = round(mean(temps),0);" gives the correct result. Thanks for your help!

Nick

doc -ef W {
del -al aa;
range aa = [%H]1!1;
range temps = aa[1:50];
fixTemp = round(mean(temps),0);

lastrow = aa.nrows;
type "$(fixTemp)";
type "$(aa(1)) $(aa(2)) $(aa(3))";
type "$(temps(1)) $(temps(2)) $(temps(3))$";

for(ii=1;ii<=aa.nrows;ii++){

//type "$(ii)";
//type "$(aa(ii))";

if (abs(fixTemp-aa(ii))<0.5)
continue;

lastrow = ii;
break;
};
type "$(lastrow)";
type "$(aa.nrows)";
range toDel = [%H]1!1[lastrow:aa.nrows];
mark -d toDel;
sec -p 10;
};

Sam Fang

293 Posts

Posted - 06/11/2012 :  07:27:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It's a known bug in 8.5. We have fixed it in 8.5.1.

Sam
OriginLab Technical Services
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