This is a problem for MapBasic programmers and it involves MapInfo
swicthing one selection cursor with another. In this case it switched a
pint of Bass for a LoveInnaCanoe brand. Horrors!
But what's going on here? If you create one temporary table with a
selection, you don't want a subsequent selection overwriting the first
when you specify a different result table. But that's exaclty what's
happening in the short application below. Does anyone know why this is,
and if there's a workaround?
' Beer.mb
' Demonstrates a bug in selection cursors. They are not persistent!
Dim i As Integer
Close All
Print Chr$(12)
' Set 'em up and display them...
Create Table BEERS (
name Char(40)
)
File ApplicationDirectory$() & "Beers.tab"
Insert Into BEERS (name) Values ("Guinness")
Insert Into BEERS (name) Values ("Bass")
Insert Into BEERS (name) Values ("Molson BarleyPop")
Insert Into BEERS (name) Values ("Red Hook")
Browse * From BEERS
' Create a selection into a cursor
Select * From BEERS Where rowid = 2 Into BEER2 NoSelect
Print "Beer 2 is " & BEER2.name
' Create another one
Select * From BEERS Where rowid = 3 Into BEER3 NoSelect
Print "Beer 3 is " & BEER3.name
' So what's happened to BEER2 ???
Print "Ha! Beer 2 is now " & BEER2.name
' --- end
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 12814