Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a confusion. in the given code i have used getprice method to get the values of a string named price.
Can some body tell me what i need to insert in this method. i have used return price; but it didnt give any respons. the fxfeed is a class that provides market values of bid and ask but the method doesnt work to get the values. please help me.

public  string price = "bid,ask";
public string getPrice()
{
}
if (fxfeed.getPrice().Equals("bid,ask"))
{
	Response.Write("Bid: " + quote["bid"]);
	Response.Write("Ask: " + quote["ask"]);
}
else
{
	Response.Write(("Price: " + quote["price"]));
}
Posted
Updated 19-Jul-11 5:27am
v2

1 solution

Without seeing whatever it is that fxfeed.GetPrice does, the only thing I can assume is that you are throwing away whatever it does return. Either that, or fxfeed does some seriously non-OOP playing with your instances internal data when you call it's methods.

If fxfeed.GetPrice returns the prices, then it would be sensible to store them somewhere, before you start looking at your quote array content.

If it doesn't, then what does affect the quote array content, and how?
 
Share this answer
 
Comments
saifullahiit 19-Jul-11 15:46pm    
sir the fxfeed.getPrice returns the prices from a website. to some extend you that point is correct that it should be stored somewhere. so can u tell me how to store them in to temporary variables?
OriginalGriff 20-Jul-11 3:41am    
In what format does it return them? String, custom class, key-value pair, list, array,...?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900