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
 Problem with vectorbase::FindDuplicate

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
tumstudent Posted - 03/01/2011 : 3:53:30 PM
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System: Windows 7

Hi everybody,

I have a problem with Origin Pro 8.5G SR1 when programming in OriginC. The code is the following:


void wksDelDoubleEntries(string wksname, string colname)
{
Worksheet wks(wksname);
	
string ds0name = wksname+"_"+colname;
Dataset ds0(ds0name);
vector v0(ds0);
	
vector<int> vnMapIndices;
vector<uint> vnR1s;
int nRet = v0.FindDuplicates(vnMapIndices, vnR1s);
 
if(vnR1s.GetSize()>1)
	{
		for(int i=0; i<vnR1s.GetSize(); i++)
		{
			out_int("Vector entry", vnR1s[i]);
		}
	}    	
}


Now when trying to compile this I get an error like

07AddAnalysis.c
Linking...
[folder...]\110302 Origin Analysis\07ADDANALYSIS.C(750) :Error, external DLL cannot find function FindDuplicates
Linking Failed!

can anyone please help?

Many thanks in advance,
Max
3   L A T E S T    R E P L I E S    (Newest First)
darronwolflx Posted - 03/02/2011 : 05:29:14 AM
The whole thing is just mind boggling! Windows 7 is interesting at the same time complicated as well. I nearly popped my eyes out trying to find a solution. Thanks for all the help, I'll definitely try the work on the code and check the links too.
tumstudent Posted - 03/02/2011 : 04:45:27 AM
Many thanks, the error is gone now but somehow no duplicates are recognized (even though there definitely is some). Solved the problem in a less elegant way now:

void wksDelDoubleEntries(string wksname, string colname)
{
	Worksheet wks(wksname);
	
	string ds0name = wksname+"_"+colname;
	Dataset ds0(ds0name);
	vector v0(ds0);
	
	for(int i=ds0.GetSize()-1; i>0; i--)
	{
		if(ds0[i]==ds0[i-1])
		{
			wks.DeleteRow(i);
			printf("Deleted Row in "+wksname);
		}
	}
	
}
Penn Posted - 03/02/2011 : 01:00:28 AM
Hi Max,

The method FindDuplicates only works for string type vector, For numeric type vector, you need to convert the vector to string type vector first. You can use the function convert_double_vector_to_string_vector to make the conversion in your case here.

Penn

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