the aim is to keep adding up new price values of ordered items to the old one previously in the textbox (no matter the amount of time orders were made) so that the gross price of the Total sales can at the end of a day can be seen from the TotalSales
textbox at the end of a daily sales period. i've tried to use the (+=) method but it doesn't add new values to old ones instead, it adds them to the textbox with a coma separating them. i included the relevant part of the code below.
if (boxes[i].Checked == true)
{
select += SecondMenuList[i].ToString() + " : " + "\t\t" +
Check[i].ToString("c") + "\r\n";
Price += Check[i];
TotalPrice = Price.ToString("c");
txtTotalPrice.Text += TotalPrice;
the second queston:
The gist is this way:
string[] SecondMenuList = new string[6];
SecondMenuList = {"carrier", "ball", "copper", "batton", "Krest", "Yatch"};
is declared as the main array.
Then the stream of inputs from a microcontroller read from the serialport buffer
is arranged into an array with the code;
string[] PortVal = { port.ReadExisting() };
of which PortVal should be in the form:
PortVal = {cop,yat,car,bat};
after this is done, i now want to compare the elements present in PortVal at any
index to see if they match the first three alphabet letters
of the elements in the SecondMenuList array at any index of the array:
for (int i = 0; i < 6; i++)
{
if (PortVal[i] == SecondMenuList[i])//but this only checks if the elements are equal
{
//lines of code
}
so please if there is anyway to work this through, help me out.
Thanks
edit: Please, use code tags when posting code.
This post has been edited by Curtis Rutland: 13 June 2011 - 10:25 AM

New Topic/Question
Reply



MultiQuote







|