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
 getfilename command

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
Bempel Posted - 04/22/2003 : 04:03:45 AM
Hello,
I use the getfilename *.dat command to get multiple ASCII files in worksheets. The filenames have the name structure ex50_xx where xx is a number that increases from 1 to whatever I want. The problem is now I have a script that works well if the the xx value is below 99. Once this value passes 100, the script execution stops. Here is the script :

[Main]
getfilename *.dat;
getnumber "rayonne" r;

getnumber
(start) ini
(stop) nbc
(Enter the graphs to be plotted);

// next command sets the range for mean calculation
getnumber
(start) rr1
(stop) rr2
(Enter temperature range used to find the mean);

// now specify the starting temperature
getnumber ( ) temp (Enter initial temperature...);

getnumber
(start) xx1
(stop) xx2
(Enter frequency range);





loop (ii,ini,nbc) {
type $(ii);
%O=%[%a,'_']_$(ii).dat;
win -t wks;
open -w %O;
type %O;
type %H;
work -c M;
work -c N;
work -c O;
work -c P;

%H_M=abs(%H_H);
%H_N=%H_H+r;
%H_O=abs(%H_I);
%H_P=atan(%H_I/%H_N)*180/3.14159265;

// find mean of col(L)
set col(L) -bs rr1;
set col(L) -es rr2;
sum(col(L));

run.section(,MakePlot); // create plot, add datasets to layer, etc.

label -s -p 103 0 \+(%H); // labels the graphs name on given position

%L="T\-(c) = $(temp) °C"; // create string for temperature
%M="T\-(eff) = $(sum.mean,.2) °C"; // create string for column mean
// %L=%L
//%M; // combine %L and %M as single 2-line string
label -s -p 103 5 \+(%L); // create label from string. (change position as desired)
label -s -p 103 10 \+(%M);

temp=temp
};



[MakePlot]
%J=%H;
win -t plot rheo G%[%O,'.'];

page.active=1; // activate layer 1


layer.include(%J_O,201);
layer.include(%J_M,201);
layer.include(%J_N,201);
layer.include(%J_I,201);


set %J_I -k 2; // shape#=1 (square), 2 (circle), ...
set %J_I -cse 1;
set %J_I -csf 18;
set %J_I -z 8;

set %J_M -k 1; // shape#=1 (square), 2 (circle), ...
set %J_M -csf 1; // fill color#=1 (black), 2 (red), 3 (green), etc
set %J_M -cse 1; // edge color
set %J_M -z 8; // set symbol interior 2=open

set %J_N -k 5;
set %J_N -csf 2;
set %J_N -cse 2;
set %J_N -z 8;

set %J_O -k 1;
set %J_O -cse 1;
set %J_O -csf 18;
set %J_O -z 10;

layer -b c 1;
X1=xx1; X2=xx2; // x-axis range
Y1=1; Y2=100000; // y-axis range

page.active=2; // activate layer 2

layer.include(%J_P,201);

layer -b c 1;
X1=xx1; X2=xx2; // x-axis range
Y1=-10; Y2=60; // y-axis range

set %J_G -k 2;
set %J_G -cse 1;
set %J_G -csf 18;
set %J_G -z 8;

page.active=1;

Can anyone tell me please what I have to change in the script so that it executes even with numbers above 100?

Thanks

Stephane
2   L A T E S T    R E P L I E S    (Newest First)
Bempel Posted - 04/22/2003 : 11:28:56 AM
The problem is fixed. There is fortunately no problem with the script
Mike Buess Posted - 04/22/2003 : 10:42:54 AM
Hi Stephane,

I see nothing obviously wrong with your script. Your import loop types the index 'ii', file path\name '%O' and active worksheet name to the script window. Do all of those show up correctly when ii=100? If not, which are missing? That may give us a clue about where the error is occurring.

You might also enter 'echo=1' in the script window before you run your script, so that all errors will be typed to the script window. ('echo=0' turns this off.) If your script generates any errors you could copy/paste them to this forum.

Mike Buess
Origin WebRing Member

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