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
 wcopy and workbook scripts

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
DataConv Posted - 09/10/2010 : 04:27:14 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.1G SR3
Operating System: XP Pro SP3

When applying the wcopy command, one can make a full copy of a sheet. That is nice. To copy only the formats without data, the option c:=0 can be applied. oK.
But: I want to make a copy of a sheet (w/o data) - but without copying the worksheet script attached to the origin sheet! Best solution would be keeping the script in the target sheet... Is there an option or way to do so?
BTW:
* the wcopy command copies the attached script - but not the conditions for execution - so it's a bit inconsistent, luckily...
* If a sheet is copied manually within a book (using 'Duplicate') - then everything is copied. E.g. the script plus conditions. This should be kept for future...
5   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 09/15/2010 : 9:23:02 PM
Hi,

I see what the problem is now. We will add option to handle with this issue in the future version. Thank you for reporting this.

Penn
DataConv Posted - 09/14/2010 : 06:45:11 AM
I have to correct myself concerning the script option copy. I did a small test by myself and found the reason. Ok, here we go:
This is the starting point:

Then the workbook script with condition 'Execution when a value of the second column is changed':
aa$ = page.name$;
type Processing workbook %(aa$);
if (aa$ == "Book2") {type Double execution!; break;};
type Start workbook copying...;
wcopy [Book1]1! [Book2]1! a:=0;
type Copying finished!;


Note the entry part of the script. You have to check, whether the copied workbook/sheet is processed. Alternatively, one could delete the new created sheet at the end of the script.
NOT DOING SO RESULTS IN A CRASH OF ORIGIN!!!
That is what the script window responds:

As can be seen, the script is executed a second time. If it was not halted, Origin would crash because the sheet processed would be overwritten by the wcopy command.
And the final result looks like this:

Note that although the activate option is set to zero, the target book/sheet is activated. Probably due to the execution of the script...

Therefore it would really make sense to implement a switch controlling the script copy as you suggested. Suppressing the condition check while script execution on the other hand seem to me NO solution, since this restricts program variability too much (conditionally chained script execution - you can program really nice things with that!).
Penn Posted - 09/14/2010 : 05:51:36 AM
Hi,

I have tried and found that the scripts in Worksheet Script window all were copied to the target worksheet, together with the status of the check-box. You have mentioned that wcopy command would copy the attached script, but not the conditions for execution. Could you explain what conditions? It will be better to provide some steps or screen shots.

By the way, we will consider to adding option for controlling this. Thank you for your suggestion.

Penn
DataConv Posted - 09/14/2010 : 02:59:23 AM
Thanks Penn for the response.
But no, I mean another script: If you have an active worksheet, you can attach a script to a sheet using the main menu bar: worksheet / worksheet script. I mean this one...
Penn Posted - 09/14/2010 : 02:55:57 AM
Hi,

Does the attached script mean the script in Script Panel (show by selecting item Show Script Panel from the right-click menu of the workbook title bar)? If so, the wcopy X-Function cannot copy these script when the output worksheet is not in the current workbook. That is because these scripts are attached to the workbook, but not the worksheet, and wcopy is used to create a copy of worksheet, not workbook.

If the attached script means the script in the Set Column Values, a parameter option keep in wcopy can be used to decide whether or not to keep the column formula.

Penn

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