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
 naming of matrix copies

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 - 01/18/2005 : 2:51:05 PM
Origin Version (Select Help-->About Origin):7.0 SR4
Operating System:XP

Hi,
a good way to copy a big matrix with OriginC seems to be the following:

void matrix_copy()
{
MatrixLayer mat;
MatrixLayer matSource("mymatrix");
int nOption = CREATE_VISIBLE_SAME;
BOOL bRet = mat.CreateCopy(matSource, nOption);
}

After each execution a new copy of "mymatrix" is generated in an new window, having a new name (mymatrixN, where N is an integer increment number).

Here's my problem:
Is it possible to change the code, so that the copy is always generated in an already existing window without channging its name?

Thanks for any help

Stefan

2   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 01/19/2005 : 3:57:46 PM
Hi Stefan,

Here is an alternative method that doesn't involve destroying and recreating the Results matrix...

void matrix_copy(string sMatName)
{
Matrix m1(sMatName);
if( !m1 )
return;
uint nCols = m1.GetNumCols();
uint nRows = m1.GetNumRows();
MatrixPage mp("Results");
if( !mp )
{
mp.Create("Origin.otm");
mp.Rename("Results");
}
Matrix m2("Results");
m2.SetSize(nRows,nCols);
m2 = m1;
}


Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 01/19/2005 3:59:24 PM
tinkusch Posted - 01/19/2005 : 3:11:28 PM
Hi,
I found the following solution:

void matrix_copy()
{
MatrixLayer matdelete("Results");
matdelete.Destroy();
//deletes matrix "Results" first if there is any!
MatrixLayer mat("newmat");
MatrixLayer matSource("Matrix1");
int nOption = CREATE_VISIBLE_SAME;
BOOL bRet = mat.CreateCopy(matSource, nOption);
mat.GetPage().Rename("Results");
//renames matrix "newmat" to "Results".
}

bye

Stefan





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