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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Help with Point grabber

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
thiago.maf Posted - 06/13/2009 : 4:08:46 PM
Origin Ver. and Service Release (Select Help-->About Origin): 8.0 SR5
Operating System: Windows 7

Hi...

Anyone could help to fix my code?

This code is supposed to grab points and put then in a worksheet.

A ----- B
pt(1) pt(2)
pt(2) pt(3)
pt(3) pt(4)
pt(i) pt(i+1)

But sometime, I don't know why, some values in the result worksheet is empty (--). It looks like some var is making this.

Second, it's common that the code crash and my Origin can't do nothing, waiting for a code response. I guess it is some infinite loop.

Thanks
1   L A T E S T    R E P L I E S    (Newest First)
thiago.maf Posted - 06/13/2009 : 4:10:43 PM
[Intervalos]
// point selection script
del -a; // delete temporary datasets
del -v index*; // delete previous indices

done=0; // initialize script
getpts 1; // select 4 points;


// pointproc macro runs each time a point is selected
def pointproc {

index$(getpts.count)=getpts.index; // point index
getyesno (Deseja continuar?) answer (LaFA);

if( answer==1 ) {
getpts.max++;
}

if( getpts.count==getpts.max ) {
{endtoolbox};
dotool 0;
};
};

// endtoolbox macro runs after all points are selected
def endtoolbox {
done=1;
index0=getpts.count; // save the point count
%A=xof(%C); // X data
for(ii=1;ii<=index0;ii++) {
temp$(ii) = %A[index$(ii)];
temp$(ii) /= 10000;
type "$(temp$(ii)) $(temp$(ii+1))";
};
};

// wait until designated number of points is selected
for(kk=1;kk>0;) {
if( done ) break;
sec -p 1; // pause 1 second
};

// insert the rest of your script here
win -t;

wks.ncols = 2;
wks.name$ = "Intervalos";
Col(1)[L]$ = "Início";
Col(2)[L]$ = "Fim";

for (nn=1;nn<=getpts.count-1;nn++) {
//type "$(temp$(nn)) $(temp$(nn+1))";

cell(nn, 1) = temp$(nn);
cell(nn, 2) = temp$(nn+1);
};

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000