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
 options.firstmode does seem to fail

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
heckljo Posted - 11/07/2017 : 12:25:22 PM
Origin Ver. and Service Release (Select Help-->About Origin): 9.0.0
Operating System: Win 7

Hello Guys,

at first please note I am totally new to programming. Im stuck at a pretty basic function as I am trying to import csv files from our spectrometer. Frist baby steps are:

I want origin to import the file and put it in a new workbook. I therefore use the tree options... to define this.

string fn$ ="V:\Fak_WT\PERS\WT-Metalle\Projekte aktuell\RiBe_Warmfeste Al-Schrauben\Messungen\OES\2024\Ref\P1.1\2024 Ref P1.1_1.csv";
impcsv fname:=fn$ Options.FirstMode:=3;

Hence, Origin responds with "command error"
No workbooks are open yet when Im entering these lines in the command window.
adding "newbook;" at the start of my lines seems so solve the problem somehow. It leaves me with alot of questions marks why options... is irgnored/interpretated incorrectly

Thanks already for your support,

Philipp
4   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 11/09/2017 : 11:05:12 PM
Hideo's example of adding quotes to a string variable is incorrect. When using string variable there is no issues with spaces in the file path.

The key is that the impscv function import a file to an existing book, so you must first have a workbook before you can use this x-function, like you have found out.

It is true that this x-function should report proper error when the input book does not exist.

CP
heckljo Posted - 11/08/2017 : 11:06:36 AM
A good morning to you Hideo,

thank you so much for your fast resposne, i appreciate it.

I thought we solved it as no command error message was given. Hence, i found out that more likely this happened due to the usage of origin on my laptop, which hast V 9.3.226 on it. Here, no command error was recieved neither using double quotes nor without them.

May this be a bug or a general issue of V 9.0.0?

Regards,

Philipp
Hideo Fujii Posted - 11/07/2017 : 4:09:18 PM
Hi Philipp,

Becsause your path/file name contains spaces, double-quoting the file name as below in impcsv command may work:
impcsv fname:="fn$" Options.FirstMode:=3;
Could you please try?

--Hideo Fujii
OriginLab
greg Posted - 11/07/2017 : 4:08:37 PM
All X-Function parameters have default values. When you do not specify a parameter value, Origin uses the default value.
In this case, you did not specify the orng value so the function assumes the active window is a Workbook and will fail if it is not.

There is no hope!
(But I may be wrong.)

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