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
 Origin Forum
 How to rename a plotted function graph?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

stevechang

Taiwan
9 Posts

Posted - 03/04/2002 :  9:51:14 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I used the add function graph to plot a function graph. Origin defaults a name to this function graph like F1. How do I rename it?

Jose

Netherlands
93 Posts

Posted - 03/05/2002 :  10:03:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can modify the way that NewFunctions are named by adding this macro definition at the end of your macros.cnf file, located at the Origin folder:

def newfunction {
for(ii=1;ii>0;ii++) {
%n=F$(ii); if(exist(%n)==1) continue;
break; };
%n=F$(ii); // standard F# name

getstring (Function name) %n (New Function);
// ask if standard name is valid:
// type a new one of you want

%n=%b;

if(exist(%n)==1)
{
for(ii=1;ii>0;ii++) {
%n=%b$(ii); if(exist(%n)==1) continue;
break; };
%n=%b$(ii);
type -b "Already exists!\nUsing %n";
};
// add a number at the end if that given
// name exists.

create %n -f 10;
def ErrorProc {del %n;};
set %n; // edit function
del -m ErrorProc;
}


To update the definition, you should restart Origin or run the macros file executing "run macros.cnf".

To rename an existing function, use the set command with the -n option, like this:

set OldName -n NewName;



- Jose Via
Origin WebRing member


Edited by - Jose on 03/05/2002 10:18:29
Go to Top of Page

stevechang

Taiwan
9 Posts

Posted - 03/07/2002 :  11:45:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you for your help.
I aslo found some scripts from TEMPLATE.OGS and copied to the custom.ogs. It also works, thought I have no idea what the differences are.

//////////////
%B=%C;
GetStr -s Template.FunctionNewName %B;
set %C -n %B;
clr;
break;
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