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
 same window name in a loop
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

sstavis

USA
Posts

Posted - 03/22/2004 :  11:28:52 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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!

sammi.song

China
46 Posts

Posted - 03/23/2004 :  04:48:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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 */

};
Go to Top of Page

sstavis

USA
Posts

Posted - 03/23/2004 :  09:56:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks sammi.song! That fixed it.
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