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
 Creating a Folder with LabTalk?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

polphys

Germany
Posts

Posted - 01/23/2005 :  4:38:09 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): V7.0
Operating System:Windows 2000

Hi,

is there any possibility to create a new folder in the project explorer within a LabTalk script? I have a large amount of worksheets and graphs within one project and such a folder structure would be helpful. Is there any command to create such folders, which I have overlooked?

Thanks in advance.

easwar

USA
1965 Posts

Posted - 01/23/2005 :  9:23:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

In version 7.0, there is no direct support for Project Explorer from LabTalk. However, Origin C can be used to access the Project class to perform Project Explorer operations. One could then build Origin C functions which can then create new script commands that can then be used from LabTalk.

For example, if you create a new Origin C file with the following function, and then compile and link the file:


void pe_mkdir(string subfolderName)
{
Folder fld = Project.ActiveFolder();
Folder subfld = fld.AddSubfolder(subfolderName);
if( !subfld.IsValid() )
{
printf("Error!!! Can't Create new subfolder %s !\n", subfolderName);
}
}


you can then go to script window (or add line in OGS script file) such as:
pe_mkdir "subfolder name"
to add a new subfolder at current PE folder level.

If you download the 7.5 demo, you will find a file called LT_PE.c under the \OriginC\OriginLab subfolder which has many such functions that essentially add new script commands for PE access from LabTalk. You should be able to then copy over that file to 7.0 and compile it - it is compatible with 7.0 - may need latest 7.0 Service Release.

Easwar
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