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
 LabTalk Forum
 PointProc macro problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

perger

Hungary
3 Posts

Posted - 10/16/2001 :  10:07:00 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have to write a script that acts as follows:

The user selects 4 points on a curve. (PointProc #1).
The script uses these points to calculate something (e.g. their sum.)
Then, the user selects two intervals. (PointProc #2 and #3).
The script performs some calculations on the two intervals.

The problem is the following:
1.) The script does not wait for GetPTS or DoToolbox to finish,
thus PointProc #3 redefines PointProc #1-#2.
2.) I could use an EndToolbox macro containing PointProc #2, but it does not
work, either.

Please suggest a solution if one exists.

Regards,
Tamas Perger

Mike Buess

USA
3037 Posts

Posted - 10/16/2001 :  11:52:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
There is a Knowledge Base article on using GetPts that might help you. Just use the keyword "GetPts" and then Submit Query.

Mike Buess
Origin WebRing Member
Go to Top of Page

CStorey

Canada
137 Posts

Posted - 10/17/2001 :  12:35:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

I read the article this morning. It is a good intro but doesn't address any more advanced issues like how to re-use the PointProc macro for several itterations.



Craig Storey
Origin WebRing Member - http://nav.webring.yahoo.com/hub?ring=originwebring
Go to Top of Page

Laurie

USA
404 Posts

Posted - 10/17/2001 :  4:29:08 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Tamas,

This script should do what you need.

getpts 4;
def endtoolbox {
sum=0;
loop(ii,1,4){
sum+=%C[_indx[ii]];}
type -a "Sum is $(sum)";
done=1;
}
for(done=0;done==0; ) {
sec -p .05;
}

getpts 2;
def endtoolbox {
mks1=_indx[1];
mks2=_indx[2];
integrate %C;
type -a "Area under %C from $(_xpos[1]) to $(_xpos[2]) is $(integ.area).";
done=1;
}
for(done=0;done==0; ) {
sec -p .05;
}

Note the infinite for loop can be used anytime you want your script to wait until the appropriate number of points have been selected by the user.

OriginLab Technical Support
Go to Top of Page

perger

Hungary
3 Posts

Posted - 10/30/2001 :  09:52:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Laurie,

Thank you for the answer. I solved the problem in another way:
I created a button "Next step" that called different sections in an OGS file, depending on a counter.
In each section I defined a different PointProc macro.
This method solved my problem, but the method you suggested seems to be more sophisticated.
Thanks again,
Tamas



quote:

Hi Tamas,

This script should do what you need.

getpts 4;
def endtoolbox {... done=1;}
for(done=0;done==0; ) { sec -p .05;}

getpts 2;
def endtoolbox {... done=1;}
for(done=0;done==0; ) { sec -p .05;}

Note the infinite for loop can be used anytime you want your script to wait until the appropriate number of points have been selected by the user.

OriginLab Technical Support

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