Here I guess the problem is that the variable has been put in quoutes. remove 
the quotes and it whould be working

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

Peter Horsb�ll M�ller
GIS Developer
Geographical Information & IT
 
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
 
Tel     +45 6311 4900
Direct  +45 6311 4908
Mob     +45 5156 1045
Fax     +45 6311 4949
E-mail  [EMAIL PROTECTED]
http://www.cowi.dk/gis


-----Original Message-----
From: Uffe Kousgaard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 19, 2005 7:46 AM
To: [email protected]
Subject: Re: MI-L MapBasic help


Remember this line at the top of your application:

include "mapbasic.def"

Kind regards

Uffe Kousgaard
www.routeware.dk


----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, May 19, 2005 4:23 AM
Subject: MI-L MapBasic help


> 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,


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To 
unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16526



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16538

Reply via email to