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
 Forum for Origin C
 wks to mat

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
tinkusch Posted - 11/28/2006 : 09:17:04 AM
Origin Version (Select Help-->About Origin): 7.5 German
Operating System:XP

Hi folks,
I like to write a labtalk script which converts a worksheet directly into a matrix with the option y-values vary over columns & x-values in first column. I also want to set the range of the worksheet to be converted.
I have found out that the origin -c function OnOpenDMC()
can be used but I do not understand how to preset/select the above options in a labtalk script.
Any help welcome, thanks!

Stefan



3   L A T E S T    R E P L I E S    (Newest First)
larry_lan Posted - 11/29/2006 : 12:12:00 AM
Hi Stefan:

Just like Mike mentioned, I think you'd better use the matrixbase::CopyFromWks function. Like
 
void test()
{
int c1 = 1, c2 = 4, r1 = 2, r2 = 6;
Worksheet wks("Data1");
Matrix mat("Matrix1");
BOOL bRet = TRUE;
if(mat && wks)
bRet = mat.CopyFromWks(wks, c1, c2, r1, r2);
}


Where c1, c2, r1, r2 is the range specified.

Larry
OriginLab Technical Services
tinkusch Posted - 11/28/2006 : 10:32:08 AM
Hi Mike,
I found OnOpenDMC()in the wks.ogs script in the [Wks2Mat] subroutine.
OnOpenDMC()simply opens the Dialog Builder Direct Matrix Conversion dialog box. It uses an other function in the OMat.c source, which probably can do the job:

int convert_wks_to_matrix_direct(string strWksSelection, int iDataFormat, MatrixPage& mpOut)

So far I do not yet understand how to use this function directly!?

Anyway, your suggestion also works ... thanks!
bye

Stefan


Edited by - Tinkusch on 11/28/2006 10:36:45 AM
Mike Buess Posted - 11/28/2006 : 10:09:22 AM
Hi Stefan,

Don't know where you found OnOpenDMC() (maybe an import function?) but matrixbase::CopyFromWks copies a specified range from a worksheet to a matrix. If you need to reorder the columns you must do so separately.

Mike Buess
Origin WebRing Member

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