![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Hmm ... I don't see any error in this code sample.
What happens if you try this: Code:
Sub UpdateTable(Score,Level)
ScoresTable.RemoveRow(9)
ScoresTable.AddRow(Score, Level, Date(now))
ScoresTable.TableSort ("Score DESC, Level DESC")
ScoresForm.Show
End Sub
Last edited by specci48 : 05-20-2007 at 06:09 PM. |
|
||||
|
I've removed the , and then it errors.
I've also tried to sort using only the Score column but it still ends up with the data in the rows getting mixed up. This is probably really simply to solve but its got me beat ![]() Regards, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
|
||||
|
No, both columns are set as cStrings because when the table is first started I display blanks but if I set the columns as cNumber then 0's are displayed which looks a little unsightly.
I don't understand why the data in the rows would get mixed up using either cString or cNumber, surely the data in each row should stay constant, just the position of the row should change in relation to the data that is being sorted. Thanks, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
|
||||
|
TableSort doesn't sort the table once.
It keeps the table sorted all the time. Now, when you write: ScoresTable.Cell("Score",9)=Score Row 9 will change depending on the score value. The next update (level update) will update another row. As specci49 wrote you should add a new row at once and you don't need to use TableSort each time (it doesn't do anything). |
|
||||
|
When I replied earlier I hadn't seen Specci48's reply, we must have both been replying at the same time. I see now what I need to do, instead of updating the values in the cells I should remove the row and then add a new row with the updated data. I'll give it a go and let you know how I do.
Thanks for the help. Regards, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
|
||||
|
Thank you, removing the last row then adding a new row has done the trick. I hadn't properly understood that TableSort kept the table sorted even after new data is entered.
It's almost ready to be published now Regards, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
|
||||
|
Hi RandomCoder,
it doesn't matter that you missed my post. The same happend to me not long ago. Now I reload every thread I had posted to after sending, just to be sure I hadn't missed something. And in this special case it was a "plus" to miss it because... ... if you had read my post, you may have changed your code which has solved the problem. ... now Erel has referenced to my post (who the fu.. ist specci49 ??? ) and you changed your code which has solved the problem. But additionally now we all know how TableSort is really working since Erel explained, that a table is sorted all the time. specci48 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Table.filter problems | J12345T | Questions & Help Needed | 1 | 08-19-2008 08:19 AM |
| SORT / TRIM Table(CSV) | sintaq | Questions & Help Needed | 1 | 03-24-2008 10:52 AM |
| how to sort this kind of file? | Stellaferox | Questions & Help Needed | 9 | 02-24-2008 11:21 AM |
| Table sort / date | bob | Questions & Help Needed | 1 | 11-16-2007 09:15 AM |
| Sort with SQL | JJM | Questions & Help Needed | 1 | 06-07-2007 02:03 PM |