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
 searching for worksheet name

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
Qiang Posted - 07/24/2003 : 06:18:33 AM
Hi all,

I'm trying to write an if statement in an OGS file.

I have 2 worksheets open when I execute this command. One called "WinName" the other called "WinName-info". Where the string WinName is specified by the user. the only difference is the ending where one worksheet has the string -info attatched to the end. When the if statement is run, the user has already chosen columns in the WinName worksheet so that is the active worksheet.

To keep the program general, I'd like to loop through all the worksheet names that is open when the if statement is run. WinName can not be passed into the if statement. I'd like to go through all the worksheet names and search for any worksheetname that ends in "-info"( this can be changed if necessary). And if so the if statement does something and else does something else.

Is it possible?

thanks

Qiang
2   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 08/21/2003 : 2:22:31 PM
You can use this to find those worksheet windows that end in "info":

doc -e W
{
if("%[%H,$(%[%H]-3):%[%H]]" == "Info")
{
type %H MATCH FOUND;
// Put your INFO code here
}
else
{
type %H doesn't match "Info";
// Put you NOT INFO code here
}
};

Since Origin doesn't support '-' in a window name, maybe what you are seeing is a window name plus a label which appears as:
WindowName - WindowLabel

Here is a modification that searches for worksheets where the window Label is "info":

doc -e W
{
%A = page.label$;
if("%A" == "Info")
{
type %H MATCH FOUND;
// Put your INFO code here
}
else
{
type %H doesn't match "Info";
// Put you NOT INFO code here
}
};


Mike Buess Posted - 07/24/2003 : 6:19:56 PM
Hi Qiang,

I'm not sure I understand completely what you want to do, but I think the "doc -e W { script }" command is what you want. It loops through all existing worksheets and applies the bracketed script to each. For example...

doc -e W {
ty %H;
};

...that types the name of each existing worksheet. (%H holds the wks name in each iteration.)

Mike Buess
Origin WebRing Member

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