Hi Gerald,

Firstly, after the user has made the selection using standard tools it might 
be good idea to check that the selection was made from the correct table and 
how many parcels were picked, something like:
'---------------------------------------------------------------------------  
 ----------------------------
if SelectionInfo(SEL_INFO_TABLENAME)<>"My_Table" then
     note "ERROR! You must select the required parcels from ...Try again..."
     exit sub
     else
end if

'*** then place the selection name into a variable gQSR_Sel_name ( a 
string):
gQSR_Sel_name = SelectionInfo(SEL_INFO_SELNAME)

'*** Maximum of 1 (?) Parcels can be selected ***
if SelectionInfo(SEL_INFO_nrows)>1 then
Note "A maximum of 1 parcels can be selected. You have selected 
"+SelectionInfo(SEL_INFO_nrows)+". Please try again"
exit sub
end if

'*** If all is well, use the fetch statement to get the PID information you 
require thus:

Fetch first from gQSR_Sel_name
varPID = selection.PID
Do while not EOT(gQSR_Sel_name)
     '*** Do your SQL stuff here...
     Fetch next from gQSR_Sel_name
     varPID = selection.PID
     i=i+1     
loop 
'*** can use above to work with more than one parcel at a time - good luck 
with the SQL syntax though!

This code is cut from one of my applications and works ok,  - but may need 
adapting to your app now I have hacked it about!

Hope this gives you some ideas,

Regards,
Pete, Ordnance Survey, UK.

 ----------
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: MI MB  extract info from Selection
Date: 09 March 1999 22:46

This is probably because I've been staring at my monitor for too long...

I have a map of land parcels.  Each parcel has a PID and an attribute key (2
col table).

I need to use the PID of the parcel that a user clicks on in a map.  As in, 
I
want to assign the PID from the
click selection to a variable that I can use in a later SQL statement, sort 
of
like:

varPID = selection.PID

Select * From parcel_table
Where parcel_table.PID = varPID

It seems to me that this must be simple, and that I'm missing the obvious.

Thanks
Gerald
 ----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]



***************************************************************
*     This email/attachment(s) has been virus checked at OS   *
*         and is free of all known viruses.  
*                                  
* All non work related emails/attachments should be deleted
*        to comply with 'Internet code of practice'    
*           as per office notice 524/98.          
*                                            
***************************************************************





----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to