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
 Creating a Folder with LabTalk?

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
polphys Posted - 01/23/2005 : 4:38:09 PM
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.
1   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 01/23/2005 : 9:23:03 PM
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


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