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
 Script not well working
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bedibra

France
35 Posts

Posted - 08/25/2017 :  12:16:55 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear all,
I have made a script which is supposed to lunch from graph (after click on text in the graph).

range rwi=[book1]index!1;
window -a graph1;
count=0;
dotool 3;
dotool -d;
def pointproc {
count++;
if(count == 3) dotool 0;
rwi[count] = index;
}
def quittoolbox {
window -a book1;
page.active$ = results;
}

The problem is that it is not working every time I click on it (not getting the index values when I click on the graph), whereas when I lunch the script from the command window it works well.
Can someone tell me what could be the problem ?
Thanks

Edited by - bedibra on 08/25/2017 12:20:19 PM

Hideo Fujii

USA
1582 Posts

Posted - 08/25/2017 :  3:04:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi bedibra,

I cannot explain well, but it seems relating to the matter of scope.
Try to move the range declaration inside the def block for the macro declaration.

--Hideo Fujii
OriginLab
Go to Top of Page

bedibra

France
35 Posts

Posted - 08/25/2017 :  7:43:39 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Indeed this works better :) :
window -a graph1;
count=0;
dotool 3;
dotool -d;
def pointproc {
count++;
if(count == 3) dotool 0;
range rwi=[book1]index!1;
rwi[count] = index;
}
def quittoolbox {
window -a book1;
page.active$ = results;
}


quote:
Originally posted by Hideo Fujii

Hi bedibra,

I cannot explain well, but it seems relating to the matter of scope.
Try to move the range declaration inside the def block for the macro declaration.

--Hideo Fujii
OriginLab

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