| T O P I C R E V I E W |
| sstavis |
Posted - 03/22/2004 : 11:28:52 AM Hello,
I am writing a loop in Origin 6.0 that manipulates, plots, and fits data.
It works perfectly when I enter and update the index variable manually and run the code outside of the loop.
But when I run it inside the loop, Origin gives me an "Another window already has this name..." error message when it tries to plot the new data. For some reason, Origin thinks that the name "Graph1" is already taken by the previous plot, despite the fact that I rename each plot with every cycle of the loop.
Here is the relevent part of the code:
for (kk=1;kk<=kkmax;kk=+1) { /* ---> MAIN LOOP <--- */
ll=2*kk; /* even column counter */ mm=ll-1; /* odd column counter */ work -s $(mm) 8 $(ll) 710; /* select data to plot*/
vv=kk-1; %v=File$(vv); %w=%vFit;
/* plot the data using an FCS template */
work -p 200 "C:\Program Files\Microcal\Origin 6.0\FCS_Samuel.OTP";
win -r %H %V_%E; /* renames "Graph1" w/ a relevent name */ win -d; /* duplicates plot */ win -r %H %V_%Eb; /* renames duplicated plot */ win -a %V_%E; /* makes the first plot active */
/* a lot of fitting code */
};
Any ideas?
Thanks! |
| 2 L A T E S T R E P L I E S (Newest First) |
| sstavis |
Posted - 03/23/2004 : 09:56:12 AM Thanks sammi.song! That fixed it. |
| sammi.song |
Posted - 03/23/2004 : 04:48:38 AM Hi sstavis,
It works fine for me when I use "kk ++" or "kk += 1", instead of "kk=+1" in For loop. I use Group.dat as an example FYI, hope it would be useful.
for (kk = 1; kk <= 2; kk ++) //use "kk ++" instead of "kk=+1" { ll=2*kk; /* even column counter */ mm=ll-1; /* odd column counter */ win -a Group; //re-active the worksheet work -s $(mm) 1 $(ll) 6; /* select data to plot*/
vv=kk-1; %v=File$(vv); %w=%vFit;
/* plot the data using an FCS template */
work -p 200 origin.otp;
win -r %H %V_%E; /* renames "Graph1" w/ a relevent name */ win -d; /* duplicates plot */ win -r %H %V_%Eb; /* renames duplicated plot */ win -a %V_%E; /* makes the first plot active */
}; |
|
|