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
 Accessing the status bar with LabTalk

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
ChristianJ Posted - 12/01/2015 : 10:21:30 AM
Origin Ver. OriginPro 2015G (64-bit) Sr2
Operating System: Windows7


Hello Experts
I'm wondering if it is possible to get access to the status bar with LabTalk. I have some "set value scripts", which are really slow. It would be just fine to get an information about the status of such calculations - like "##% done", refreshed every 1000th iteration. (Over all, about 15s after starting the calculation, Origin is "Not Responding" untill the end of the calculation. I assume, this could be a little problem when trying to access the status bar...)
5   L A T E S T    R E P L I E S    (Newest First)
ChristianJ Posted - 12/03/2015 : 03:02:53 AM
Hi kfauth
You're right: The script is definitely too slow and must be optimized. But that would be another topic But I think the screenupdating thing is not the problem. Origin seems not to update anything while it is calculating. But I know what you mean - in Excel-VBA the turned off screenupdating is solving 90% of the speed problems.

Hi Sean
thank you for your reply. While it is not exactly what I was looking for, it is even better. But the best about the break command is, it is preventing that Origin is getting not responding. Great!

Here is my code:

string str1$ = __lastwks$;

range r1 = [str1$]6!11; //the target column
range r2 = [str1$]6!5; //the source column (the values must be summarized row by row)
range r3 = [str1$]6!10; //the condition column (a one in this column sets the sum to zero)

r1 = {1: r2.GetSize()}; //the worksheet will have about 100000 rows
r1 = 0;

int jj = 0;
break -b "Count something";  
break -r 0 r1.GetSize();

//iterating through all rows seems to be very slow...
for (ii=2; ii<r1.GetSize(); ii++)
{

    if(r3[ii] == 0)
    {
        r1[ii] = r1[ii-1] + r2[ii];
    }

    if(r3[ii] == 1)
    {
        r1[ii] = 0;
    }

    jj++;
    if(jj == 1000) 
    {
        jj = 0;
        break -p ii;
    }    
} 

break -end;
SeanMao Posted - 12/02/2015 : 10:52:33 PM
Hi,

You can create a Progress Bar to know the progress, a sample code would be as following:


break -b This is the caption for the dialog box;  
break -r 0 100;  // the range of values will be 0 - 100 
for (ii = 0; ii <= 100; ii=ii+5) // Show every 5 percentage 
{
      break -p ii;   // the current value is ii
      csetvalue col:=col(a) formula:="i";// Put your code here
      csetvalue col:=col(b) formula:="cos(col(a))";
      //sec -p .1;   // Delay to simulate executing code
};
break -end;  // done, close the dialog box


Hope this can be some help.

Regards!

Sean

OriginLab Tech.
kfauth Posted - 12/02/2015 : 07:55:20 AM
Not from my side, sorry. I would like to think that in general this is not so much an "Origin not responding" thing, but rather a means to speed up the calculation. Updating the display can take a huge amount of time which you'd like your computer to spend on calculating.
I have seen such things also with other code (outside origin) I have written. All of asudden, when the screensaver came in, my code executed almost 10 times faster...

But an option to update -- not on every iteration -- but ocasionally, as you write, would really be interesting in order to know whether you can go out for lunch, have a coffee or something, before the calculatin is finished.

Therefore I also would welcome a comment by Originlab Tech staff.
ChristianJ Posted - 12/02/2015 : 07:25:25 AM
Hi kfauth
this was exactly what I was looking for! Dankeschön

But as I assumed it is a problem that Origin is not responding after a couple of seconds... Any hints for this?
kfauth Posted - 12/02/2015 : 05:05:15 AM
you may use

type -q  some string

"-q"
is the option to display
some string
in the status bar.

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