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
		
}
};