Hi Tiago,
>There is a way to put it in a function... ??
Here is what you can do:
1) In your User Files Folder, using the Notepad, make a script file, say myUtilities.ogs ,
which contains the definition of the function in the following code:[Main]
@global=1; //make the function global
function double revert (double colpos) {
// colpos: Specify which col to be reversed
nc=wks.ncols+1; //number of columns
range rr=wcol(colpos);
nr=rr.getSize(rr); //number of rows
wcol(nc)=data(1,nr,1); //generate sequence in added column
sort.cname1$="D: "+ wks.col$(nc).name$; //Set sequence in descending
sort.c1=colpos; sort.c2=colpos; //subjected columns
sort.r1 = 1; sort.r2 = nr; //subjected rows
sort.wks(); //execute sorting
del wcol(nc); //delete added column
return colpos;
}
@global=0; //restore global setting
2) Also in the UFF, edit Origin.ini to insert the following line in the [Startup] section: file1=myUtilities.ogs
Now, you can use this revert function (which takes a single argument) anytime in your Origin session.
Hope this helps.
--Hideo Fujii
OriginLab