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
 Script works only with some data files

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
bmmaoso Posted - 10/05/2004 : 11:27:38 AM
Origin Version 6,0.

Hello!

I am working with origin importing some data files with labtalk, but I don't know why it works good only for some data files and only sometimes. when I import the data files I change the name and the label of the columns; and if I try to change it with script writing in the Script window there is a command error. And if I do it manually, there is a message indicating that this name is used for other dataset, but I can not see this name in the heading columns (that is not visually true). It is really strange.

My script just to import the data file and name the columns is:

win -t wks;
fdlog.numTypes=1;
fdlog.Type1$= "[All files (*.*)] *.*";
if (fdlog.open() != 0){
win -c;
};
open -w %A;
wks.col1.width=15;
wks.col1.name$=Date;
wks.col2.name$=Filter;
wks.col3.name$=Mass;
wks.col1.label$=Date;
wks.col2.label$=Filter;
wks.col3.label$=Mass;
wks.labels(0);

Could you help me to find what is wrong in the script?

Thank you very much

Maria
4   L A T E S T    R E P L I E S    (Newest First)
bmmaoso Posted - 10/06/2004 : 12:43:29 PM
Hi Mike!

Thank you very much. I solved my problem.

Maria
Mike Buess Posted - 10/06/2004 : 09:02:32 AM
Hi Maria,

Here is a pretty safe way to remove all unattached datasets. It makes a list of all datasets that are not columns in existing worksheets and also are not matrices and then deletes all datasets on the list.

%Z="";
doc -e S {
if(exist(%[%C,'_'],2)==0 && exist(%C,5)==0) %Z=%Z %C;
};
for(i=1;i>0;i++) {
%A=%[%Z,#i]; if(%A=="") break;
del %A;
};

...Although it should be safe I suggest you save your project before trying.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 10/06/2004 09:09:15 AM

Edited by - Mike Buess on 10/06/2004 09:12:57 AM

Edited by - Mike Buess on 10/06/2004 09:22:15 AM
bmmaoso Posted - 10/06/2004 : 08:07:21 AM
Hi Mike!

Thank you for your help. But I imported some files many times and deleted them in the wrong way and now I have the dataset in the memory of my project, can you tell me please how can I delete the dataset from the memory? When I write 'List s' in the script window I can see them, but I don't know how to delete them.

Thank you very much

Maria
Mike Buess Posted - 10/05/2004 : 12:44:33 PM
Hi Maria,

In Origin 6.0 the command win -c deletes the worksheet window but does not delete its datasets (column data). Enter 'list s' in the script window and you'll see they still exist. Use this instead...

win -t wks; %W=%H;
fdlog.numTypes=1;
fdlog.Type1$= "[All files (*.*)] *.*";
if (fdlog.open() != 0) {
repeat wks.ncols {del col(1)}; // delete all columns
win -c %W; // delete window
break 1; // you probably want to quit now
};
- rest of script -

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 10/05/2004 12:46:38 PM

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