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
 same window name in a loop

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
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 */

};

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