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
 "Add function graph" auto-naming fails
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Jose

Netherlands
93 Posts

Posted - 03/06/2000 :  8:41:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
In Origin 6.0, if I have some function graphs in different layers over the project, and I have deleted some of the first ones so only F4, F5, F7 and F8 left, and I want to Add function graph again, it is quite usual that the dialog that appears is not the Plot Details for F9 (or F1, that don't exist, and could be OK), but that for F4.

This is not what I want, of course: I don't want to do without F4. But if I then press Cancel, F4 is deleted. I have to press OK if I want to keep F4 there. After this, it doesn't matter how many times I select Add function graph: always appears F4's definition dialog. When I get tired of this I write my new function over F4, changing its functionality F4(x)=. After this it may be F5 that has the same problem, or it can temporaly work properly letting me define F2 or F6 (!) before forcing me to overwrite F5 or F7.

As an example of this, feel free to download one of my projects (7.5 kB). I've deleted all the worksheets and almost all the graphs. Only functions and one graph left. Active layer #2 (the one below) and try to add a new function!

Has anyone experienced something similar? Am I doing something wrong? Is there any way to let me name the functions I create, or is it always an automatic process? Has this auto-naming process a correspondant script that I could check or modify?

Thanks in advance.

------------------
Jose Viña

[This message has been edited by Jose (edited 03-06-2000).]

Gary Lane

USA
150 Posts

Posted - 03/07/2000 :  5:19:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Thanks for reporting this problem. I will notify our developers. In the mean time, I have a work around for you. Open the text file MACROS.CNF (in your origin software folder) using any text editor and copy/paste the script below at the very end of the file. Save and then exit from the MACROS.CNF file. After restarting Origin you should be all set...let me know if you still have problems.

-Gary



def newfunction {
for(ii=1;ii>0;ii++) {
%B=F$(ii);
if(exist(%B)==1) continue;
break;
};
create %B -f 10;
def ErrorProc {del %B;};
set %B;
del -m ErrorProc;
}

[This message has been edited by Gary Lane (edited 03-08-2000).]

Go to Top of Page

hschaefer

Germany
3 Posts

Posted - 03/07/2000 :  8:46:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

following your instructions, I first get also Layer2-F3 with its many-decimals-equation in that dialog.

But after using the Cancel-button and immediately trying to add a function-graph again, I then get Layer2-F2 with a different, short equation: 4.0e4*x^(-1). ?!

Now, using Cancel again, suddenly leads to F1. (Couldn´t decrease it to F-1 :-)

Strange!

Hubert

Go to Top of Page

Jose

Netherlands
93 Posts

Posted - 03/07/2000 :  8:50:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That's what I told you: you are not decreasing in numbers, you are deleting every function each time you press Cancel (try to add them to any layer, you won't see them!), so the next time you "Add function..." it is the previous one that appears.

Looks like a bug!? (Oops! I realize I should have reported this to the bug section: I'll do it now.)

Go to Top of Page

Gary Lane

USA
150 Posts

Posted - 03/08/2000 :  5:05:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You shouldn't run the NewFunction macro on the command line by itself without first executing the GetEnumWin macro. At the very least, a Function or Graph window should be active prior to executing the NewFunction macro.

Try:

GetEnumWin Function;
NewFunction;

Also, canceling out of a dialog box automatically generates a command error.

Go to Top of Page

Gary Lane

USA
150 Posts

Posted - 03/08/2000 :  8:19:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi...

Glad you are all set with this one. The semi-colon should definitely be there and I think the [ ]'s in place of the { }'s is an archaic notation. Anyway, I updated the post...thanks!

The set %B; command opens the Plot Details dialog box providing an interface to enter the new function. The ERRORPROC macro gets executed if you click the Cancel button in the Plot Details dialog box. This is why your old existing functions were deleted as you reported above. My naming fix should prevent this problem from happening anymore.

I enjoyed working on this problem...thanks.

-Gary

Go to Top of Page

Jose

Netherlands
93 Posts

Posted - 03/08/2000 :  8:32:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Another minor problem:

if I run this new newfunction macro from the script window and I cancel the operation in the dialog, I get a non-important #Command error! caused by... what?

(I am using your corrected macro, with proper def ErrorProc {del %B;};)

Go to Top of Page

Jose

Netherlands
93 Posts

Posted - 03/08/2000 :  8:34:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ho, ho! Thanks a lot! Appart from solving my problem you have taught to me some nice tricks with this answer!

Some minor details:

- You missed a semicolon at the end... didn't you?

del -m ErrorProc;

- On your third line from the end shouldn't you use curly brackets?

def ErrorProc {del %B};

(I don't understand very well the use of this last three lines, but I imagine it has to do with some internal use of the ErrorProc macro by the set command...)

Jose.

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