Hi guys'n'gals
I have a field of numbers (barcodes) that I loop through in order to populate a table-field with data from a database (i.e. read the barcode and add a row to the table field-showing the product description etc). I populate column one of each table row with an 'X'. If I click in the first column of a row, my code checks for the 'X', then deletes the line from the table and re-populates the table with the remaining rows (by looping the table-field rows to find the 'X's in the first column, building a temporary variable, then writing this back into the table-field). So as far as the user is concerned, the row has now been deleted.
HOWEVER, if I now add a new barcode into the barcode field and process it, the new table-field row this produces does not appear immediately after the 'new' last row but after what appears to be a 'blank' row .... as if the table-field KNOWS that there used to be a row there (like there is a behind-the-scenes row count?)!
I've read everything I can find on table fields and cRevTable but have failed to find a 'row count' setting or anything else that will solve my dilemma ...... please help me!!
Kind regards
Lawrence
Deleting table field rows
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Well there's a glib answer and a "well I don't really know without some more info" answer.
To delete a line is there any reason why you aren't simply using?
And inserting the new line by using?
I'm assuming that your code needs to be more complicated than that, but without some more info as to what you're doing and the how/why of it, I don't know what to suggest.
To delete a line is there any reason why you aren't simply using
Code: Select all
delete line <x> of field "tableField"
And inserting the new line by using
Code: Select all
put cr & <new barcode data> after field "tableField"
I'm assuming that your code needs to be more complicated than that, but without some more info as to what you're doing and the how/why of it, I don't know what to suggest.
Thanks for that SparkOut ...... what is it they say about not seeing the wood for the trees??!?
I was indeed doing exactly as you suggested but had got so wrapped up in looking for issues with the 'delete a table row' aspect that I was totally forgetting a global 'line count' variable I was using on the insert side of things. It was this that was holding the original number of rows and causing the odd blank line in the table.
Many thanks for bringing me back to my senses by calmly stating the obvious.
Kind regards
Lawrence
I was indeed doing exactly as you suggested but had got so wrapped up in looking for issues with the 'delete a table row' aspect that I was totally forgetting a global 'line count' variable I was using on the insert side of things. It was this that was holding the original number of rows and causing the odd blank line in the table.
Many thanks for bringing me back to my senses by calmly stating the obvious.
Kind regards
Lawrence