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
 Forum for Origin C
 Call function...help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Bigprophete

France
20 Posts

Posted - 06/05/2015 :  05:20:34 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I have a little question...I have created a program (see the next of the message) which works very well. But after to open origin, I don't want to copy/past my line program and compile it before to use my function...I just want to call my function vsm and put my value in ().

I am searching a line code like run.section (name data file)... but when I do it with my file function, it doesn't work...

Any idea ?

function vsm (double Slope) {
doc -ef W {

wks.col1.name$ = Field ; // rename column as Field
wks.col2.name$ = Data ; // rename column as Data
wks.addcol(mcorr); // add a column for mcorr, named mcorr

col(mcorr)=col(Data)/col(Corr);


wks.addcol(Datasub);
wks.addcol(Magnetization);
Col(Field)[U]$ = Oe; // Set column unit
Col(Data)[U]$ = emu; // Set column unit
Col(Datasub)[U]$ = emu; // Set column unit
Col(Magnetization)[U]$ = Tnm; // Set column unit


col(Datasub)=col(mcorr)+Slope*col(Field); // substract paramagnetism

}
};

SeanMao

China
288 Posts

Posted - 06/05/2015 :  06:28:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

To run a function written by LabTalk, you have to firstly save an OGS file under User File Folder. Then as shown in the figure below:



Then you can run the function by:


run.section(Test1, Test, 5)


Regards!

Sean




quote:
Originally posted by Bigprophete

Hi,

I have a little question...I have created a program (see the next of the message) which works very well. But after to open origin, I don't want to copy/past my line program and compile it before to use my function...I just want to call my function vsm and put my value in ().

I am searching a line code like run.section (name data file)... but when I do it with my file function, it doesn't work...

Any idea ?

function vsm (double Slope) {
doc -ef W {

wks.col1.name$ = Field ; // rename column as Field
wks.col2.name$ = Data ; // rename column as Data
wks.addcol(mcorr); // add a column for mcorr, named mcorr

col(mcorr)=col(Data)/col(Corr);


wks.addcol(Datasub);
wks.addcol(Magnetization);
Col(Field)[U]$ = Oe; // Set column unit
Col(Data)[U]$ = emu; // Set column unit
Col(Datasub)[U]$ = emu; // Set column unit
Col(Magnetization)[U]$ = Tnm; // Set column unit


col(Datasub)=col(mcorr)+Slope*col(Field); // substract paramagnetism

}
};

Go to Top of Page

Bigprophete

France
20 Posts

Posted - 06/07/2015 :  8:35:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much, I will tried

With best regards
Go to Top of Page

Bigprophete

France
20 Posts

Posted - 06/07/2015 :  8:52:59 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Great ! It works !! :) Thank you very much for your help.
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