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
 Forum for Origin C
 reactivate script window
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cjfraz

USA
22 Posts

Posted - 04/29/2004 :  9:56:58 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have a really simple OC function that I am running from the script window. It has a body basiclaly like this:

 
void merge(string strSource, string strTarget){
Worksheet wksSource;
Worksheet wksTarget;
wksSource.Attach(strSource);
wksTarget.Attach(strTarget);

// do some other stuff.

wksSource.Destroy();
}



The wksSource.Destroy(); line has the desired effect of deleting the source worksheet, but it aslo seems to remove the focus from the script window. Is this by design?

How can I run this code and still have a blinking cursor in the script window waiting for new input when it is done?

Thanks for any help.

J...

cpyang

USA
1406 Posts

Posted - 04/29/2004 :  10:49:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Does a wks being destroy execute some LT script on Window Close? As I was not able to see the problem with just empty new worksheets.

CP


Go to Top of Page

cjfraz

USA
22 Posts

Posted - 04/29/2004 :  11:36:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
No... no close event or anything else that I have set up.

I can copy the code right out of the above message, run just that bit on empty new worksheets, and get the problem.

I'm using OriginPro 7.5 SR2 (7.5817).

J...
Go to Top of Page

cjfraz

USA
22 Posts

Posted - 04/29/2004 :  11:51:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hmmmm...

It seems that the relative index of the source sheet vs. the target sheet may be the difference, such that everything is fine if the target has the higher index, but not if the source does.

So for example, using the code in my orginal post and a brand new project with 2 empty worksheets,

typing 'merge data2 data1' into the script window will cause a loss of focus on the script window, but 'merge data1 data2' will not.

This general principle seems to hold for larger numbers of worksheets.

J...
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 05/04/2004 :  6:42:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes, thanks, I can see the problem now.
I am not sure about the solution yet, but we will look further, trackered as 6382.

CP




Edited by - cpyang on 05/08/2004 02:52:54 AM
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