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
 How to use a DOS command argument in 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

hkkim

Republic of Korea
35 Posts

Posted - 09/27/2012 :  03:56:18 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8.1
Operating System: Windows XP

Hello!
My question is about a batch processing. Here is my example below.
The location of 'InputDesign.xlsx' is hardwired now.
Is it possible to designate the path variablely using a DOS command argument ? How can I get 'D:\Origin\' from 'Run.bat' in 'ReadDraw.ogs' ?

Thanks in advance!
hkkim
----------------------------------------------------------
Run.bat:
Origin81.exe -r (run.section(D:\Origin\ReadDraw.ogs,main))
----------------------------------------------------------
ReadDraw.ogs:
....
newbook; // create new workbook before
string fn$=D:\Origin\InputDesign.xlsx;
if(0 == exist(fn$) ) return; // Check for 'not exist'
impexcel fname:=fn$; // Import Excel file
----------------------------------------------------------

Penn

China
644 Posts

Posted - 09/27/2012 :  05:57:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi hkkim,

You can read the document for run.section() here. You can provide the argument for this method to pass into the section in the ogs. Maybe you can try:

Run.bat:
Origin81.exe -r run.section(D:\Origin\ReadDraw.ogs, main, "D:\Origin\")

ReadDraw.ogs:
...
string fn$=%1InputDesign.xlsx; // if you hope to use here, %1 hold the first argument passed by the run.section method
...

Penn
Go to Top of Page

hkkim

Republic of Korea
35 Posts

Posted - 09/28/2012 :  01:29:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello, Penn!

My question was solved with your help. I checked LabTalk Wiki site as your suggestion. Thank you so much! Happy thanksgiving day! ^:^

hkkim
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