I'm using vers. 4.03, build 230 on a windows 98SE system.
tbl.unmark_range()
This high-level utility appears to alter the current index without warning. When run, it seems to change the current index to record_number order, regardless of which other index may have been in effect when it was invoked.
Try this with a table that has at least one production index.
tbl = table.open("yourdbf")
tbl.index_primary_put("yourindextag")
tbl.fetch_first()
trace.writeln("some value from the current record"+" is first before unmarking")
tbl.fetch_last()
trace.writeln("some value from the current record"+" is last before unmarking")
tbl.unmark_range() 'unmark all recs in current range
tbl.fetch_first()
trace.writeln("some value from the current record"+" is first after unmarking")
tbl.fetch_last()
trace.writeln("some value from the current record"+" is last after unmarking")
tbl.close()
When I do this the paired before and after values are different because the table
is ordered by record number after the unmarking is completed.
If this is working as designed, it's a bit counter-intuitive and probably needs to be documented in the xbasic ref. manual.
I had quite a bit of difficulty this evening because I was trying to mark records in a particular way and began my script by unmarking everything. Unbeknownst to me this caused the sort order of the records to be different since the table reverted to record number order... which caused my marking exercise to behave incorrectly. Naturally I checked everything... and I do mean everything... before finally finding out what was happening.
-- tom
tbl.unmark_range()
This high-level utility appears to alter the current index without warning. When run, it seems to change the current index to record_number order, regardless of which other index may have been in effect when it was invoked.
Try this with a table that has at least one production index.
tbl = table.open("yourdbf")
tbl.index_primary_put("yourindextag")
tbl.fetch_first()
trace.writeln("some value from the current record"+" is first before unmarking")
tbl.fetch_last()
trace.writeln("some value from the current record"+" is last before unmarking")
tbl.unmark_range() 'unmark all recs in current range
tbl.fetch_first()
trace.writeln("some value from the current record"+" is first after unmarking")
tbl.fetch_last()
trace.writeln("some value from the current record"+" is last after unmarking")
tbl.close()
When I do this the paired before and after values are different because the table
is ordered by record number after the unmarking is completed.
If this is working as designed, it's a bit counter-intuitive and probably needs to be documented in the xbasic ref. manual.
I had quite a bit of difficulty this evening because I was trying to mark records in a particular way and began my script by unmarking everything. Unbeknownst to me this caused the sort order of the records to be different since the table reverted to record number order... which caused my marking exercise to behave incorrectly. Naturally I checked everything... and I do mean everything... before finally finding out what was happening.
-- tom
Comment