Point Of Sale System (POS)

Hello all I am doing a POS system for my restaurant and I need a little help:

I have my main form that has all the buttons with all the items for my menu.

When I click on the button I want it to post the item AND its price in {insert best option here} as a list, it will then calculate all of the items prices as they are entered and give a total at the bottom with another button to "pay now" which sends the items to a printer to be printed as a receipt.

Could you please point me in the direction of:
what do I use as the receipt listing with totals

I had thought about TValueListEditor is this the right choice and how do I insert the button clicks with prices into this list?

Comments

  • : Hello all I am doing a POS system for my restaurant and I need a
    : little help:
    :
    : I have my main form that has all the buttons with all the items for
    : my menu.
    :
    : When I click on the button I want it to post the item AND its price
    : in {insert best option here} as a list, it will then calculate all
    : of the items prices as they are entered and give a total at the
    : bottom with another button to "pay now" which sends the items to a
    : printer to be printed as a receipt.
    :
    : Could you please point me in the direction of:
    : what do I use as the receipt listing with totals
    :
    : I had thought about TValueListEditor is this the right choice and
    : how do I insert the button clicks with prices into this list?
    :
    :
    I would use a TList, which stores each product in separate objects, along with its price and number. When you design the objects correctly, then the code of adding a new value to the receipt is simple enough:
    [code]
    ReceiptList.Add(TProduct.Create("Some Product", 1.76, 3));
    [/code]
    This code adds 3x Some Product for a price of 1.76 to the list.
    Calculating the price is equally simple:
    [code]
    for i := 0 to ReceiptList.Count-1 do
    TotalPrice := TotalPrice + TProduct(ReceiptList.Items[i]).Price;
    [/code]
  • : : Hello all I am doing a POS system for my restaurant and I need a
    : : little help:
    : :
    : : I have my main form that has all the buttons with all the items for
    : : my menu.
    : :
    : : When I click on the button I want it to post the item AND its price
    : : in {insert best option here} as a list, it will then calculate all
    : : of the items prices as they are entered and give a total at the
    : : bottom with another button to "pay now" which sends the items to a
    : : printer to be printed as a receipt.
    : :
    : : Could you please point me in the direction of:
    : : what do I use as the receipt listing with totals
    : :
    : : I had thought about TValueListEditor is this the right choice and
    : : how do I insert the button clicks with prices into this list?
    : :
    : :
    : I would use a TList, which stores each product in separate objects,
    : along with its price and number. When you design the objects
    : correctly, then the code of adding a new value to the receipt is
    : simple enough:
    : [code]:
    : ReceiptList.Add(TProduct.Create("Some Product", 1.76, 3));
    : [/code]:
    : This code adds 3x Some Product for a price of 1.76 to the list.
    : Calculating the price is equally simple:
    : [code]:
    : for i := 0 to ReceiptList.Count-1 do
    : TotalPrice := TotalPrice + TProduct(ReceiptList.Items[i]).Price;
    : [/code]:


    I wnat it to add the item to the list each time the button is pushed and auto calculate the price totals.

    I downloaded a free version of a POS system and it has what I am trying to do unfortunatly it is not open source and the "extras" are not calculated and that is what I need, if you would take a look at this screen shot you may get a better idea of what I am trying to do

    http://www.bluemesapc.com/bmrpos.html
    box I am trying to create is on the far right, with totals (I am in China so do not need tax or sub total just total.
    I also need to be able to remove items if highlighted
  • : : : Hello all I am doing a POS system for my restaurant and I need a
    : : : little help:
    : : :
    : : : I have my main form that has all the buttons with all the items for
    : : : my menu.
    : : :
    : : : When I click on the button I want it to post the item AND its price
    : : : in {insert best option here} as a list, it will then calculate all
    : : : of the items prices as they are entered and give a total at the
    : : : bottom with another button to "pay now" which sends the items to a
    : : : printer to be printed as a receipt.
    : : :
    : : : Could you please point me in the direction of:
    : : : what do I use as the receipt listing with totals
    : : :
    : : : I had thought about TValueListEditor is this the right choice and
    : : : how do I insert the button clicks with prices into this list?
    : : :
    : : :
    : : I would use a TList, which stores each product in separate objects,
    : : along with its price and number. When you design the objects
    : : correctly, then the code of adding a new value to the receipt is
    : : simple enough:
    : : [code]: :
    : : ReceiptList.Add(TProduct.Create("Some Product", 1.76, 3));
    : : [/code]: :
    : : This code adds 3x Some Product for a price of 1.76 to the list.
    : : Calculating the price is equally simple:
    : : [code]: :
    : : for i := 0 to ReceiptList.Count-1 do
    : : TotalPrice := TotalPrice + TProduct(ReceiptList.Items[i]).Price;
    : : [/code]: :
    :
    :
    : I wnat it to add the item to the list each time the button is pushed
    : and auto calculate the price totals.
    :
    : I downloaded a free version of a POS system and it has what I am
    : trying to do unfortunatly it is not open source and the "extras" are
    : not calculated and that is what I need, if you would take a look at
    : this screen shot you may get a better idea of what I am trying to do
    :
    : http://www.bluemesapc.com/bmrpos.html
    : box I am trying to create is on the far right, with totals (I am in
    : China so do not need tax or sub total just total.
    : I also need to be able to remove items if highlighted
    :
    The list looks most like a TStringGrid. This can also be populated from a TList. It is often a good design to separate the GUI from the actual data. This way you can change the GUI, without needing to rewrite your entire program.
  • : : : : Hello all I am doing a POS system for my restaurant and I need a
    : : : : little help:
    : : : :
    : : : : I have my main form that has all the buttons with all the items for
    : : : : my menu.
    : : : :
    : : : : When I click on the button I want it to post the item AND its price
    : : : : in {insert best option here} as a list, it will then calculate all
    : : : : of the items prices as they are entered and give a total at the
    : : : : bottom with another button to "pay now" which sends the items to a
    : : : : printer to be printed as a receipt.
    : : : :
    : : : : Could you please point me in the direction of:
    : : : : what do I use as the receipt listing with totals
    : : : :
    : : : : I had thought about TValueListEditor is this the right choice and
    : : : : how do I insert the button clicks with prices into this list?
    : : : :
    : : : :
    : : : I would use a TList, which stores each product in separate objects,
    : : : along with its price and number. When you design the objects
    : : : correctly, then the code of adding a new value to the receipt is
    : : : simple enough:
    : : : [code]: : :
    : : : ReceiptList.Add(TProduct.Create("Some Product", 1.76, 3));
    : : : [/code]: : :
    : : : This code adds 3x Some Product for a price of 1.76 to the list.
    : : : Calculating the price is equally simple:
    : : : [code]: : :
    : : : for i := 0 to ReceiptList.Count-1 do
    : : : TotalPrice := TotalPrice + TProduct(ReceiptList.Items[i]).Price;
    : : : [/code]: : :
    : :
    : :
    : : I wnat it to add the item to the list each time the button is pushed
    : : and auto calculate the price totals.
    : :
    : : I downloaded a free version of a POS system and it has what I am
    : : trying to do unfortunatly it is not open source and the "extras" are
    : : not calculated and that is what I need, if you would take a look at
    : : this screen shot you may get a better idea of what I am trying to do
    : :
    : : http://www.bluemesapc.com/bmrpos.html
    : : box I am trying to create is on the far right, with totals (I am in
    : : China so do not need tax or sub total just total.
    : : I also need to be able to remove items if highlighted
    : :
    : The list looks most like a TStringGrid. This can also be populated
    : from a TList. It is often a good design to separate the GUI from the
    : actual data. This way you can change the GUI, without needing to
    : rewrite your entire program.

    I added a TStringGrid to play around with it, but how do I set sizes to each of the cols? Also how do I create the top satatic name (Food/Price)
    And finaly button push to input info?
    Thank you
  • : : : : : Hello all I am doing a POS system for my restaurant and I need a
    : : : : : little help:
    : : : : :
    : : : : : I have my main form that has all the buttons with all the items for
    : : : : : my menu.
    : : : : :
    : : : : : When I click on the button I want it to post the item AND its price
    : : : : : in {insert best option here} as a list, it will then calculate all
    : : : : : of the items prices as they are entered and give a total at the
    : : : : : bottom with another button to "pay now" which sends the items to a
    : : : : : printer to be printed as a receipt.
    : : : : :
    : : : : : Could you please point me in the direction of:
    : : : : : what do I use as the receipt listing with totals
    : : : : :
    : : : : : I had thought about TValueListEditor is this the right choice and
    : : : : : how do I insert the button clicks with prices into this list?
    : : : : :
    : : : : :
    : : : : I would use a TList, which stores each product in separate objects,
    : : : : along with its price and number. When you design the objects
    : : : : correctly, then the code of adding a new value to the receipt is
    : : : : simple enough:
    : : : : [code]: : : :
    : : : : ReceiptList.Add(TProduct.Create("Some Product", 1.76, 3));
    : : : : [/code]: : : :
    : : : : This code adds 3x Some Product for a price of 1.76 to the list.
    : : : : Calculating the price is equally simple:
    : : : : [code]: : : :
    : : : : for i := 0 to ReceiptList.Count-1 do
    : : : : TotalPrice := TotalPrice + TProduct(ReceiptList.Items[i]).Price;
    : : : : [/code]: : : :
    : : :
    : : :
    : : : I wnat it to add the item to the list each time the button is pushed
    : : : and auto calculate the price totals.
    : : :
    : : : I downloaded a free version of a POS system and it has what I am
    : : : trying to do unfortunatly it is not open source and the "extras" are
    : : : not calculated and that is what I need, if you would take a look at
    : : : this screen shot you may get a better idea of what I am trying to do
    : : :
    : : : http://www.bluemesapc.com/bmrpos.html
    : : : box I am trying to create is on the far right, with totals (I am in
    : : : China so do not need tax or sub total just total.
    : : : I also need to be able to remove items if highlighted
    : : :
    : : The list looks most like a TStringGrid. This can also be populated
    : : from a TList. It is often a good design to separate the GUI from the
    : : actual data. This way you can change the GUI, without needing to
    : : rewrite your entire program.
    :
    : I added a TStringGrid to play around with it, but how do I set sizes
    : to each of the cols? Also how do I create the top satatic name
    : (Food/Price)
    : And finaly button push to input info?
    : Thank you
    :
    See the help files on the following properties:
    - ColCount
    - RowCount
    - Cells[]
    - FixedCols
    - FixedRows

    The information provided by the help should be enough to answer your questions.
  • : : : : : : Hello all I am doing a POS system for my restaurant and I need a
    : : : : : : little help:
    : : : : : :
    : : : : : : I have my main form that has all the buttons with all the items for
    : : : : : : my menu.
    : : : : : :
    : : : : : : When I click on the button I want it to post the item AND its price
    : : : : : : in {insert best option here} as a list, it will then calculate all
    : : : : : : of the items prices as they are entered and give a total at the
    : : : : : : bottom with another button to "pay now" which sends the items to a
    : : : : : : printer to be printed as a receipt.
    : : : : : :
    : : : : : : Could you please point me in the direction of:
    : : : : : : what do I use as the receipt listing with totals
    : : : : : :
    : : : : : : I had thought about TValueListEditor is this the right choice and
    : : : : : : how do I insert the button clicks with prices into this list?
    : : : : : :
    : : : : : :
    : : : : : I would use a TList, which stores each product in separate objects,
    : : : : : along with its price and number. When you design the objects
    : : : : : correctly, then the code of adding a new value to the receipt is
    : : : : : simple enough:
    : : : : : [code]: : : : :
    : : : : : ReceiptList.Add(TProduct.Create("Some Product", 1.76, 3));
    : : : : : [/code]: : : : :
    : : : : : This code adds 3x Some Product for a price of 1.76 to the list.
    : : : : : Calculating the price is equally simple:
    : : : : : [code]: : : : :
    : : : : : for i := 0 to ReceiptList.Count-1 do
    : : : : : TotalPrice := TotalPrice + TProduct(ReceiptList.Items[i]).Price;
    : : : : : [/code]: : : : :
    : : : :
    : : : :
    : : : : I wnat it to add the item to the list each time the button is pushed
    : : : : and auto calculate the price totals.
    : : : :
    : : : : I downloaded a free version of a POS system and it has what I am
    : : : : trying to do unfortunatly it is not open source and the "extras" are
    : : : : not calculated and that is what I need, if you would take a look at
    : : : : this screen shot you may get a better idea of what I am trying to do
    : : : :
    : : : : http://www.bluemesapc.com/bmrpos.html
    : : : : box I am trying to create is on the far right, with totals (I am in
    : : : : China so do not need tax or sub total just total.
    : : : : I also need to be able to remove items if highlighted
    : : : :
    : : : The list looks most like a TStringGrid. This can also be populated
    : : : from a TList. It is often a good design to separate the GUI from the
    : : : actual data. This way you can change the GUI, without needing to
    : : : rewrite your entire program.
    : :
    : : I added a TStringGrid to play around with it, but how do I set sizes
    : : to each of the cols? Also how do I create the top satatic name
    : : (Food/Price)
    : : And finaly button push to input info?
    : : Thank you
    : :
    : See the help files on the following properties:
    : - ColCount
    : - RowCount
    : - Cells[]
    : - FixedCols
    : - FixedRows
    :
    : The information provided by the help should be enough to answer your
    : questions.

    Thank you but all of the help files are reffering to a TCustomGrid which I do not see the button to create... I am using Borland
  • : : : : : : : Hello all I am doing a POS system for my restaurant and I need a
    : : : : : : : little help:
    : : : : : : :
    : : : : : : : I have my main form that has all the buttons with all the items for
    : : : : : : : my menu.
    : : : : : : :
    : : : : : : : When I click on the button I want it to post the item AND its price
    : : : : : : : in {insert best option here} as a list, it will then calculate all
    : : : : : : : of the items prices as they are entered and give a total at the
    : : : : : : : bottom with another button to "pay now" which sends the items to a
    : : : : : : : printer to be printed as a receipt.
    : : : : : : :
    : : : : : : : Could you please point me in the direction of:
    : : : : : : : what do I use as the receipt listing with totals
    : : : : : : :
    : : : : : : : I had thought about TValueListEditor is this the right choice and
    : : : : : : : how do I insert the button clicks with prices into this list?
    : : : : : : :
    : : : : : : :
    : : : : : : I would use a TList, which stores each product in separate objects,
    : : : : : : along with its price and number. When you design the objects
    : : : : : : correctly, then the code of adding a new value to the receipt is
    : : : : : : simple enough:
    : : : : : : [code]: : : : : :
    : : : : : : ReceiptList.Add(TProduct.Create("Some Product", 1.76, 3));
    : : : : : : [/code]: : : : : :
    : : : : : : This code adds 3x Some Product for a price of 1.76 to the list.
    : : : : : : Calculating the price is equally simple:
    : : : : : : [code]: : : : : :
    : : : : : : for i := 0 to ReceiptList.Count-1 do
    : : : : : : TotalPrice := TotalPrice + TProduct(ReceiptList.Items[i]).Price;
    : : : : : : [/code]: : : : : :
    : : : : :
    : : : : :
    : : : : : I wnat it to add the item to the list each time the button is pushed
    : : : : : and auto calculate the price totals.
    : : : : :
    : : : : : I downloaded a free version of a POS system and it has what I am
    : : : : : trying to do unfortunatly it is not open source and the "extras" are
    : : : : : not calculated and that is what I need, if you would take a look at
    : : : : : this screen shot you may get a better idea of what I am trying to do
    : : : : :
    : : : : : http://www.bluemesapc.com/bmrpos.html
    : : : : : box I am trying to create is on the far right, with totals (I am in
    : : : : : China so do not need tax or sub total just total.
    : : : : : I also need to be able to remove items if highlighted
    : : : : :
    : : : : The list looks most like a TStringGrid. This can also be populated
    : : : : from a TList. It is often a good design to separate the GUI from the
    : : : : actual data. This way you can change the GUI, without needing to
    : : : : rewrite your entire program.
    : : :
    : : : I added a TStringGrid to play around with it, but how do I set sizes
    : : : to each of the cols? Also how do I create the top satatic name
    : : : (Food/Price)
    : : : And finaly button push to input info?
    : : : Thank you
    : : :
    : : See the help files on the following properties:
    : : - ColCount
    : : - RowCount
    : : - Cells[]
    : : - FixedCols
    : : - FixedRows
    : :
    : : The information provided by the help should be enough to answer your
    : : questions.
    :
    : Thank you but all of the help files are reffering to a TCustomGrid
    : which I do not see the button to create... I am using Borland
  • : : : : : : : : Hello all I am doing a POS system for my restaurant and I need a
    : : : : : : : : little help:
    : : : : : : : :
    : : : : : : : : I have my main form that has all the buttons with all the items for
    : : : : : : : : my menu.
    : : : : : : : :
    : : : : : : : : When I click on the button I want it to post the item AND its price
    : : : : : : : : in {insert best option here} as a list, it will then calculate all
    : : : : : : : : of the items prices as they are entered and give a total at the
    : : : : : : : : bottom with another button to "pay now" which sends the items to a
    : : : : : : : : printer to be printed as a receipt.
    : : : : : : : :
    : : : : : : : : Could you please point me in the direction of:
    : : : : : : : : what do I use as the receipt listing with totals
    : : : : : : : :
    : : : : : : : : I had thought about TValueListEditor is this the right choice and
    : : : : : : : : how do I insert the button clicks with prices into this list?
    : : : : : : : :
    : : : : : : : :
    : : : : : : : I would use a TList, which stores each product in separate objects,
    : : : : : : : along with its price and number. When you design the objects
    : : : : : : : correctly, then the code of adding a new value to the receipt is
    : : : : : : : simple enough:
    : : : : : : : [code]: : : : : : :
    : : : : : : : ReceiptList.Add(TProduct.Create("Some Product", 1.76, 3));
    : : : : : : : [/code]: : : : : : :
    : : : : : : : This code adds 3x Some Product for a price of 1.76 to the list.
    : : : : : : : Calculating the price is equally simple:
    : : : : : : : [code]: : : : : : :
    : : : : : : : for i := 0 to ReceiptList.Count-1 do
    : : : : : : : TotalPrice := TotalPrice + TProduct(ReceiptList.Items[i]).Price;
    : : : : : : : [/code]: : : : : : :
    : : : : : :
    : : : : : :
    : : : : : : I wnat it to add the item to the list each time the button is pushed
    : : : : : : and auto calculate the price totals.
    : : : : : :
    : : : : : : I downloaded a free version of a POS system and it has what I am
    : : : : : : trying to do unfortunatly it is not open source and the "extras" are
    : : : : : : not calculated and that is what I need, if you would take a look at
    : : : : : : this screen shot you may get a better idea of what I am trying to do
    : : : : : :
    : : : : : : http://www.bluemesapc.com/bmrpos.html
    : : : : : : box I am trying to create is on the far right, with totals (I am in
    : : : : : : China so do not need tax or sub total just total.
    : : : : : : I also need to be able to remove items if highlighted
    : : : : : :
    : : : : : The list looks most like a TStringGrid. This can also be populated
    : : : : : from a TList. It is often a good design to separate the GUI from the
    : : : : : actual data. This way you can change the GUI, without needing to
    : : : : : rewrite your entire program.
    : : : :
    : : : : I added a TStringGrid to play around with it, but how do I set sizes
    : : : : to each of the cols? Also how do I create the top satatic name
    : : : : (Food/Price)
    : : : : And finaly button push to input info?
    : : : : Thank you
    : : : :
    : : : See the help files on the following properties:
    : : : - ColCount
    : : : - RowCount
    : : : - Cells[]
    : : : - FixedCols
    : : : - FixedRows
    : : :
    : : : The information provided by the help should be enough to answer your
    : : : questions.
    : :
    : : Thank you but all of the help files are reffering to a TCustomGrid
    : : which I do not see the button to create... I am using Borland
  • : : : : : : : : : Hello all I am doing a POS system for my restaurant and I need a
    : : : : : : : : : little help:
    : : : : : : : : :
    : : : : : : : : : I have my main form that has all the buttons with all the items for
    : : : : : : : : : my menu.
    : : : : : : : : :
    : : : : : : : : : When I click on the button I want it to post the item AND its price
    : : : : : : : : : in {insert best option here} as a list, it will then calculate all
    : : : : : : : : : of the items prices as they are entered and give a total at the
    : : : : : : : : : bottom with another button to "pay now" which sends the items to a
    : : : : : : : : : printer to be printed as a receipt.
    : : : : : : : : :
    : : : : : : : : : Could you please point me in the direction of:
    : : : : : : : : : what do I use as the receipt listing with totals
    : : : : : : : : :
    : : : : : : : : : I had thought about TValueListEditor is this the right choice and
    : : : : : : : : : how do I insert the button clicks with prices into this list?
    : : : : : : : : :
    : : : : : : : : :
    : : : : : : : : I would use a TList, which stores each product in separate objects,
    : : : : : : : : along with its price and number. When you design the objects
    : : : : : : : : correctly, then the code of adding a new value to the receipt is
    : : : : : : : : simple enough:
    : : : : : : : : [code]: : : : : : : :
    : : : : : : : : ReceiptList.Add(TProduct.Create("Some Product", 1.76, 3));
    : : : : : : : : [/code]: : : : : : : :
    : : : : : : : : This code adds 3x Some Product for a price of 1.76 to the list.
    : : : : : : : : Calculating the price is equally simple:
    : : : : : : : : [code]: : : : : : : :
    : : : : : : : : for i := 0 to ReceiptList.Count-1 do
    : : : : : : : : TotalPrice := TotalPrice + TProduct(ReceiptList.Items[i]).Price;
    : : : : : : : : [/code]: : : : : : : :
    : : : : : : :
    : : : : : : :
    : : : : : : : I wnat it to add the item to the list each time the button is pushed
    : : : : : : : and auto calculate the price totals.
    : : : : : : :
    : : : : : : : I downloaded a free version of a POS system and it has what I am
    : : : : : : : trying to do unfortunatly it is not open source and the "extras" are
    : : : : : : : not calculated and that is what I need, if you would take a look at
    : : : : : : : this screen shot you may get a better idea of what I am trying to do
    : : : : : : :
    : : : : : : : http://www.bluemesapc.com/bmrpos.html
    : : : : : : : box I am trying to create is on the far right, with totals (I am in
    : : : : : : : China so do not need tax or sub total just total.
    : : : : : : : I also need to be able to remove items if highlighted
    : : : : : : :
    : : : : : : The list looks most like a TStringGrid. This can also be populated
    : : : : : : from a TList. It is often a good design to separate the GUI from the
    : : : : : : actual data. This way you can change the GUI, without needing to
    : : : : : : rewrite your entire program.
    : : : : :
    : : : : : I added a TStringGrid to play around with it, but how do I set sizes
    : : : : : to each of the cols? Also how do I create the top satatic name
    : : : : : (Food/Price)
    : : : : : And finaly button push to input info?
    : : : : : Thank you
    : : : : :
    : : : : See the help files on the following properties:
    : : : : - ColCount
    : : : : - RowCount
    : : : : - Cells[]
    : : : : - FixedCols
    : : : : - FixedRows
    : : : :
    : : : : The information provided by the help should be enough to answer your
    : : : : questions.
    : : :
    : : : Thank you but all of the help files are reffering to a TCustomGrid
    : : : which I do not see the button to create... I am using Borland
  • Hello again,
    I am using the following code:
    [code]
    procedure TForm1.But_Veg_SmClick(Sender: TObject);
    begin
    StringGrid1.RowCount := StringGrid1.RowCount + 1;
    StringGrid1.Rows[1]. CommaText := '1, Vegetarian, 6.00' ;
    end;
    [/code]
    the columns are as follows:
    [0] =1 (1 item (this will never change but at the end it will add them all for total number of items purchased),
    [1] = item name,
    [2] = item price

    This code populates the first available row as I wanted :) BUT, when I click the button a second time it does not move to the next line.
    Could you explain this process please (upon additional clicks move to next line and re populate).

  • : Hello again,
    : I am using the following code:
    : [code]:
    : procedure TForm1.But_Veg_SmClick(Sender: TObject);
    : begin
    : StringGrid1.RowCount := StringGrid1.RowCount + 1;
    : StringGrid1.Rows[[b][blue]1[/blue][/b]]. CommaText := '1, Vegetarian, 6.00' ;
    : end;
    : [/code]:
    : the columns are as follows:
    : [0] =1 (1 item (this will never change but at the end it will add
    : them all for total number of items purchased),
    : [1] = item name,
    : [2] = item price
    :
    : This code populates the first available row as I wanted :) BUT, when
    : I click the button a second time it does not move to the next line.
    : Could you explain this process please (upon additional clicks move
    : to next line and re populate).
    :
    :
    The blue part in the code above is the index of the row to fill. You code tells the computer to [b]always[/b] fill the second row. For the computer to move to the third row, requires some kind of counter to keep track of which row to fill. See my previous post for an example of that.
  • : The blue part in the code above is the index of the row to fill. You
    : code tells the computer to [b]always[/b] fill the second row. For
    : the computer to move to the third row, requires some kind of counter
    : to keep track of which row to fill. See my previous post for an
    : example of that.

    I did try your code, that is why I reposted my question:
    [code]
    StringGrid1.RowCount := StringGrid1.RowCount + 1;
    StringGrid1.Cells[0, StringGrid1.RowCount-1] := '1';
    StringGrid1.Cells[1, StringGrid1.RowCount-1] := 'Vegetarian';
    StringGrid1.Cells[2, StringGrid1.RowCount-1] := '6.00';
    [/code]

    This does not populate the table at all.(it is still blank)
    Whereas if I set it as a Row it populates BUT only the Row that is set (in this case is Row 1) as a comma separated insert.
  • : : The blue part in the code above is the index of the row to fill. You
    : : code tells the computer to [b]always[/b] fill the second row. For
    : : the computer to move to the third row, requires some kind of counter
    : : to keep track of which row to fill. See my previous post for an
    : : example of that.
    :
    : I did try your code, that is why I reposted my question:
    : [code]:
    : StringGrid1.RowCount := StringGrid1.RowCount + 1;
    : StringGrid1.Cells[0, StringGrid1.RowCount-1] := '1';
    : StringGrid1.Cells[1, StringGrid1.RowCount-1] := 'Vegetarian';
    : StringGrid1.Cells[2, StringGrid1.RowCount-1] := '6.00';
    : [/code]:
    :
    : This does not populate the table at all.(it is still blank)
    : Whereas if I set it as a Row it populates BUT only the Row that is
    : set (in this case is Row 1) as a comma separated insert.
    :
    The use this:
    [code]
    StringGrid1.Rows[StringGrid1.RowCount-1].CommaText := '1,Vegetarian,6.00';
    [/code]
    which is basically a combination of both.
  • [code]procedure TForm1.But_Veg_SmClick(Sender: TObject);
    begin
    StringGrid1.Rows[StringGrid1.RowCount-1].CommaText := '1,Vegetarian,6.00';

    // stringgrid1.rowcount:= stringgrid1.rowcount + 1;
    // StringGrid1.Rows[1].CommaText := '1, Vegetarian, 6.00';

    Grp_Pizza.height:=420;
    GrpVeg.Show;
    Grp_extra.Show;
    GrpHaw.Hide;
    GrpMeat.Hide;
    GrpTuna.Hide;
    GrpChs.Hide;
    end;[/code]

    This is the same result, blank.
  • : [code]: procedure TForm1.But_Veg_SmClick(Sender: TObject);
    : begin
    : StringGrid1.Rows[StringGrid1.RowCount-1].CommaText := '1,Vegetarian,6.00';
    :
    : // stringgrid1.rowcount:= stringgrid1.rowcount + 1;
    : // StringGrid1.Rows[1].CommaText := '1, Vegetarian, 6.00';
    :
    : Grp_Pizza.height:=420;
    : GrpVeg.Show;
    : Grp_extra.Show;
    : GrpHaw.Hide;
    : GrpMeat.Hide;
    : GrpTuna.Hide;
    : GrpChs.Hide;
    : end;[/code]:
    :
    : This is the same result, blank.
    :
    I've tested it using this code:
    [code]
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    StringGrid1.RowCount := StringGrid1.RowCount+1;
    StringGrid1.Rows[StringGrid1.RowCount-1].CommaText := 'Test1,Test2';
    end;
    [/code]
    It added a new row and populated that row with Test1 and Test2. The initial properties for the StringGrid1 were:
    [code]
    RowCount = 2
    ColCount = 2
    [/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories