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
 copy wks to matrix: update old script to O-Pro 8.1
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

linele

Germany
5 Posts

Posted - 10/05/2010 :  10:07:06 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System: OriginPro 8.1G

Hello there,
might be a simple trick, but how can I update this old script to the new Version of 8.1 using Longname/Shortname of the wks as new Longname/Shortname of the matrix.

mat.wksname$ = %H;
win -T M;
mat.matname$ = %H;
mat.w2m();

Thank you!

cpyang

USA
1406 Posts

Posted - 10/05/2010 :  6:48:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This script does not care about names, it simply copy the active worksheet to a new matrix.

If that is all you need to do, then just use the new w2m X-Function:


w2m



You can read more about this XF online or from the script window


w2m -h;

CP
Go to Top of Page

linele

Germany
5 Posts

Posted - 10/06/2010 :  01:54:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello CP,

and if I want to have the worksheet's short- and longname as new names for the matrix? As I have to convert a bunch of wks to matrices, so this is why I want to do it via labtalk.

Thanks again!
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 10/07/2010 :  10:14:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can not make the resutling matrix having the same shortname as the source worksheet, unless you can delete the source worksheet after the copying. The following code will prefix the result with M:

%A=%H;
%B=page.longname$;
w2m;
page.longname$=%B;
win -r %H M%A;


While the following code will del the source and name the new matrix accordingly


%A=%H;
%B=page.longname$;
w2m;win -cd %A;
page.longname$=%B;
win -r %H %A;


CP
Go to Top of Page

linele

Germany
5 Posts

Posted - 10/12/2010 :  07:13:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
THANK YOU, that is exactly what I have been looking for.
Regards from Germany.
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