Hello listers,

I'm trying to write a MapBasic script that searches two seperate fields in 
a table to zoom to an area in a Map Window.  I've come up with the 
following, but it always falls over at the CommandInfo(CMD_INFO_DLG_OK)
section - where it says variable not defined.

Can anyone offer me any help. Also, any help with the rest of it would be 
much appreciated, I'm a real beginner at this MapBasic thing.

Thanks, Matt Davis. 


Dim search_pid as Integer

Dialog 
  Title "Search"
  Control StaticText
    Title "Enter PID to find" 
  Control EditText
        Value search_pid 
        Into search_pid
  Control OKButton
  Control CancelButton

If CommandInfo(CMD_INFO_DLG_OK)
        Then Select * from parcels_shape_gda94 where Pid = 
Int("search_pid") into pid_sel
                End If

If TableInfo (pid_sel, TAB_INFO_NROWS) >= 1
        Then Set Map Clipping Object pid_sel.obj Using Display All
                End Program
Else Select * from parcels_shape_gda94 where Pid = Int("search_pid") into 
pot_pid_sel
                End If

If TableInfo (pot_pid_sel, TAB_INFO_NROWS) >= 1
        Then Set Map Clipping Object pot_pid_sel.obj Using Display All
Else
        Dialog
                Title "That's not a valid PID"
                Control OKButton
End If

Matt Davis,
Project Officer,
Crown Land Assessment and Classification Project,
Department of Primary Industries, Water and Environment
Level 5, 134 Macquarie Street, Hobart

Telephone: (03) 6233 5112
Fax: (03) 6233 6655
E-mail: [EMAIL PROTECTED]
Mailing address: GPO Box 44, Hobart, TAS, 7000

For further information on the Crown Land Assessment and Classification 
Project, visit our webpage at:
http://www.dpiwe.tas.gov.au/clac

CONFIDENTIALITY NOTICE AND DISCLAIMER

The information in this transmission may be confidential and/or protected 
by legal professional privilege, and is intended only for the person or 
persons to whom it is addressed. If you are not such a person, you are 
warned that any disclosure, copying or dissemination of the information is 
unauthorised. If you have received the transmission in error, please 
immediately contact this Office by telephone, fax or email, to inform us 
of the error and to enable arrangements to be made for the destruction of 
the transmission, or its return at our cost. No liability is accepted for 
any unauthorised use of the information contained in this transmission.

If the transmission contains advice, the advice is based on instructions 
in relation to, and is provided to the addressee in connection with, the 
matter mentioned above. Responsibility is not accepted for reliance upon 
it by any other person or for any other purpose.

Reply via email to