Problem with deleting rows and SalTblSort on date column?

forum.advanced.programming (1998-2005)
Stephen Wells

Problem with deleting rows and SalTblSort on date column?

Post by Stephen Wells » 20 Jan 2005, 00:29

 Posted by:  Stephen Wells 

Hi Guys,

There is a blank row at the top of a table with 4 other rows below. This
row gets deleted via

Set nNew = SalTblQueryContext( hWndItem )
Call SalTblDeleteRow( hWndItem, nNew, TBL_Adjust )

Then when the record is saved a call is made to

Call SalTblSortRows(tblEvents, 1, TBL_SortDecreasing)

Which is on a date column. The result is a blank row at the top and
three rows below. Ie one of the rows with data in it gets blanked out
when it gets sorted, or what I think is happening is the row I delted is
getting sorted back in and one I want to keep is getting sorted out.

Thanks for any insights.

CTD 3.0 PTF3
Win XP

micsto
Germany
Posts: 732
Joined: 07 Mar 2017, 16:07
Location: Germany

Problem with deleting rows and SalTblSort on date column?

Post by micsto » 20 Jan 2005, 08:22

 Posted by:  Michael Stoll \( MICSTO \) 

AFAIK, it's a known bug that SalTblSortRows fails when there are rows
deleted with TBL_Adjust in the table.
If possible, use TBL_NoAdjust.
Or use MTblSort( ) from M!Table ( www.micsto.de ) which has no problems with
TBL_Adjust and provides enhanced sorting facilities.

Michael

Stephen Wells

Problem with deleting rows and SalTblSort on date column?

Post by Stephen Wells » 20 Jan 2005, 23:37

 Posted by:  Stephen Wells 

OMG Thank you soooooooooo much! That saved me heaps and heaps of trouble!

You guys are awesome, you awlays help me out.

PS. I don't even get the difference between adjusting and not adjusting,
I think its some feature we aren't interested in using

Niels Allerheiligen

Problem with deleting rows and SalTblSort on date column?

Post by Niels Allerheiligen » 21 Jan 2005, 14:14

 Posted by:  Niels Allerheiligen 

I had some problems with TBL_Adjust/TBL_NoAdjust, too.

If you delete with TBL_Adjust, you can do something like this:

while SalTblSetContext(tblMyTable)
set colMyColumn = strMyValue

This loop would break before you reach the last row, if you deleted any
rows with TBL_NoAdjust. However, be aware that SalTblDoDeletes() deletes
rows with TBL_Adjust, IIRC.

HTH

-Niels-

Jim McNamara

Problem with deleting rows and SalTblSort on date column?

Post by Jim McNamara » 24 Jan 2005, 16:32

 Posted by:  Jim McNamara 

If you are doing database updates/inserts/deletes from your table, you need
to use TBL_Adjust. Otherwise always use TBL_NoAdjust.

Return to “advanced.programming”

Who is online

Users browsing this forum: [Ccbot] and 0 guests