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
 Read out workbook longname without activating
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Taron

United Kingdom
12 Posts

Posted - 03/31/2014 :  03:51:07 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.6.0 b70
Operating System: Windows 7 x64

Hi,

I am looking for a way to read out the longname of a workbook without having to active it. Currently I have to activate it first and use page.name$ to read out the workbooks longname into a string.
This is not very convenient as it slows down my script considerably.

Is there any way of reading out the longname without having to activate a workbook?

lkb0221

China
497 Posts

Posted - 03/31/2014 :  09:31:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The standard syntax of page properties is actually:

[winName!]page.property =

When [winName!] is not specified, the active window is affected.

Zheng
OriginLab
Go to Top of Page

Taron

United Kingdom
12 Posts

Posted - 03/31/2014 :  11:02:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks!
So if the short name of my workbook is e.g. Book1 and I am currently in Book2 I have to enter:

storevar$ = [Book1!]page.longname$;

to access the longname of Book1 and store it in my storevariable storevar$?

Edit: I just tried it with this syntax and it doesn't work (with or without the "!"). So what would be the actual syntax in my case?
Go to Top of Page

bastianb

Germany
3 Posts

Posted - 03/31/2014 :  11:24:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

the brackets are too much, they indicate that the including is optional

I guess this should work for you:
storevar$ = Book1!page.longname$;

best regards
Bastian
Go to Top of Page

Taron

United Kingdom
12 Posts

Posted - 03/31/2014 :  11:25:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot!
That's what I wanted.
Go to Top of Page

lkb0221

China
497 Posts

Posted - 03/31/2014 :  11:31:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Yes, the brackets indicates that it is optional. Sorry I did not make it clear in the first place.
For example:
//
window -a Book1; // Active Book1
page.longname$ = BK1; // Set page longname
window -a Book2; // Active Book2
Book1!page.longname$ = ; // Will return "BK1"
//

Zheng
OriginLab
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