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
 Origin Forum
 Labtalk - Create new folder
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Francesco84

Italy
21 Posts

Posted - 10/10/2018 :  12:37:25 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello to all,
I would like to ask a question.

I'm programming with Labtalk and I need to create a new folder in a specific path in my PC.
It is possible?

For example, is it possible to create a new folder on Desktop?

Thanks for the answers,
Francesco

cpyang

USA
1406 Posts

Posted - 10/10/2018 :  8:57:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I dont know which version of Origin you have but in a more recent version, you can find out the Desktop path by using the string register to the Apps root folder, then go back word to find the user's root, then you can use the cd command to switch to the desktop folder, then use mkdir command to create your folder.


I have tested this code with Origin 2018b, but I believe it should work in 2017 as well.


//the following LabTalk code will make a folder called "Test" on the desktop
string str$=%@A; //Apps folder
int nPos=str.Find("AppData");
str$=str.Left(nPos-1)$;
str$=str$+"Desktop";
str$=;//this should dump the desktop path
cd str$;
mkdir "Test";



CP

Go to Top of Page

Francesco84

Italy
21 Posts

Posted - 10/12/2018 :  03:36:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you Cpyang,

taking example from your code, I did as follows, in order to create a folder in any position

cd NewPath$; // change the current working directory
mkdir "Test" // create the "Test" subfolder
.
// Other operations
.
cd %Y // restore the default working directory





Francesco
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