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
 getfilename command
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Bempel

France
19 Posts

Posted - 04/22/2003 :  04:03:45 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Mike Buess

USA
3037 Posts

Posted - 04/22/2003 :  10:42:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Bempel

France
19 Posts

Posted - 04/22/2003 :  11:28:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The problem is fixed. There is fortunately no problem with the script
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