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
 win -a , loops

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
Stefan B Posted - 11/13/2016 : 11:40:09 AM
Hi,

I have 3 problems i cannot deal with.

1. How can i activete a graph previously renamed via string variable? I want to use win -a .

In this example it doesn't work:

string str$;
string str1$;
getn (A) str$ (B) str1$
(ENTER YOUR DATA);
dlgFile group:=ascii;
newpanel name:=str1$;
string wn$ = page.name$;
win -r %(wn$) %(str1$); 
newbook name:= str$ option:=lsname;
...// data importing 
...//plotting
win-a %(str1$); //DOESN'T WORK
..../graph formatting


2. how to do an endless loop (now i have 100 iterations)

Example:
loop(i,1,100){....}


3. How can i stop the loop when user press cancel button in getn window inside the loop , and then do instructions outside the loop ?
Example :
loop(i,1,100)
{
string str$;
string str1$;
getn (A) str$ (B) str1$
(ENTER YOUR DATA);
.......// some instructions
}
.....// instructions when loop is over


Regards,
Stefan Batory
1   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 11/14/2016 : 12:17:02 AM
Hi Stefan,

Answer to question 1:

I try the command win –a on my machine, it works nicely. Perhaps you miss a space between win and -a, please try it again. For example:

// it is assume that there is already a workbook named Book2
newbook name:= Test option:=lsname;
string wn$ = page.name$;
string str$="AfterTest";
win -r %(wn$) %(str$);
win –a  book2;
win -a %(str$);

Answer to question 2:

An endless loop may easily create by a While command. However, LabTalk does not have a While command. You can simulate a While loop with the for loop:

//This script continues to prompt for new values 
//until you enter zero or a negative number.
p = 1;
for ( ;p > 0; ) 
getn -s (Enter 0 to quit) p (Next value);

Answer to question 3:

I think the example above is a good answer to this question.

Regards,
Yuki
OriginLab

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