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
 initializing range

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
juggernick Posted - 06/08/2012 : 4:37:20 PM
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;
};
1   L A T E S T    R E P L I E S    (Newest First)
Sam Fang Posted - 06/11/2012 : 07:27:36 AM
It's a known bug in 8.5. We have fixed it in 8.5.1.

Sam
OriginLab Technical Services

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