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); }; |
|
|