Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Parameter Array reference.
Parameter Array reference. [message #38299] Sun, 09 December 2012 16:45 Go to next message
nejnadusho is currently offline  nejnadusho
Messages: 60
Registered: October 2012
Member
Hi,

I cant figure that out.
I want to have a parameter of array reference and I am doing the following.


.h File
class DataTransfer{
		public:
			typedef DataTransfer CLASSNAME;
			DataTransfer();
			void FetchData(const String& className, const String & value, Array<String>& getData);
			void InitiateTables( Array<String&> getData);
		
		private:		
		
	};	



.cpp File
DataTransfer::DataTransfer(){}
	void DataTransfer::FetchData(const String& className, const String & value, Array<String>& getData){
		if (className == "Tables"){
			if (value == "Initiate"){
				InitiateWorkplace(getData);
			}
		}
		
	}
		
		
		
		
	void DataTransfer::InitiateTables(Array<String>& getData){
		String start = "Tables";
		String start = "Tables End";
		getData.	
		

	}



When I get to the getData. and I want to add something to the array it does not work.

and I am calling this class from somewhere like this.

Array<String> arrrr;
String x = "Hi";
String y = "Why";
DataTransfer trans;
trans.FetchData(x,y,arrrr);





What am I doing wrong?

Thank you very much.

Best,
Georgi

[Updated on: Sun, 09 December 2012 18:30]

Report message to a moderator

Re: Parameter Array reference. [message #38304 is a reply to message #38299] Sun, 09 December 2012 18:50 Go to previous messageGo to next message
nejnadusho is currently offline  nejnadusho
Messages: 60
Registered: October 2012
Member
Ok,

That is really weird!

if I do not define the:

void DataTransfer::FetchData(const String& className, const String & value, Array<String>& getData){
		if (className == "Tables"){
			if (value == "Initiate"){
				InitiateWorkplace(getData);
			}
		}
		
	}



In other words if I just remove it from the .cpp file everything is just fine.

If define it and leave it blank inside like this
void DataTransfer::FetchData(const String& className, const String & value, Array<String>& getData){}


and compile it it is giving the following error for this line

C:\MyApps\TeamB1ServerApp\DataTransfer.cpp(11) : error C3872: '0xa0': this character is not allowed in an identifier


Also if I leave only the Array as a parameter I get exactly the same error.
I tried changing the name of the function.
And same thing.

Please any suggestions will be greatly appreciated.

Best,
Georgi
Re: Parameter Array reference. [message #38305 is a reply to message #38299] Sun, 09 December 2012 18:56 Go to previous messageGo to next message
nejnadusho is currently offline  nejnadusho
Messages: 60
Registered: October 2012
Member
I put more functions that accept an Array as a parameter and only the top one defined in the cpp file works.

There rest do not.


WOW. Shocked Shocked Shocked Shocked
Re: Parameter Array reference. [message #38307 is a reply to message #38299] Sun, 09 December 2012 19:11 Go to previous messageGo to next message
nejnadusho is currently offline  nejnadusho
Messages: 60
Registered: October 2012
Member
WOOOOOOOWWWWWw. Shocked Shocked Shocked Shocked Shocked Shocked


I got it.


SO,

DO NOT COPY THE PARAMETERS FROM THE POP UP ABOVE THE DEFINITION WHENEVER DEFINING THE FUNCTION IN THE .cpp FILE.

There are special INVISIBLE characters like the one that it is giving error 0xa0 .
That will take you 3 hours to figure it out.

Copy and paste the definition form the .h file only and write definition in the .h yourself.


WOW Laughing Laughing Laughing Laughing Laughing

[Updated on: Sun, 09 December 2012 19:13]

Report message to a moderator

Re: Parameter Array reference. [message #38324 is a reply to message #38307] Mon, 10 December 2012 06:53 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

nejnadusho wrote on Sun, 09 December 2012 19:11

DO NOT COPY THE PARAMETERS FROM THE POP UP ABOVE THE DEFINITION WHENEVER DEFINING THE FUNCTION IN THE .cpp FILE.

There are special INVISIBLE characters like the one that it is giving error 0xa0 .

That sounds like a bug, but the weird part is where would the 0xa0 come from... I used to have similar problems in past, but I always thought it is a system thing, because it happens from time to time in other (non-U++) applications as well. I was never able to get a reproducible testcase, if you could, it would be great if you could describe it here, step by step so someone can a have a look at it.

Honza
Previous Topic: Many Widget Factories one class
Next Topic: Refreshing Docked Widget/Window/Ctrl
Goto Forum:
  


Current Time: Sat May 04 16:45:19 CEST 2024

Total time taken to generate the page: 0.02979 seconds