When you pass a constant, you have to use the ByVal declaration. So your
subroutine must be declared as:

Declare Sub Table_to_Array( byval sTabname as string, ByVal sCol_1 as string,
  ByVal sCol_2 as string, ByVal sType as string)


On Wed, Jul 19, 2006 at 12:28:08PM +0100, Ian Robertson wrote:
> Hi, 
>  
> I'm having some difficulty passing parameters in a Sub procedure. 
>  
> The MapBasic help gives the following as a example of using a sub procedure. 
> It includes a value "2" as a parameter. 
> Declare Sub Cube(ByVal original As Float, cubed As Float)
> .
> .
> Call Cube( 2,  result)
> 
>  
> I've adapted this to pass some text values for a table name and some column 
> titles: 
>  
> Declare Sub Table_to_Array( byval sTabname as string, sCol_1 as string, 
> sCol_2 as string, sType as string) 
> .
> .
> Call Table_to_Array("T_Usrn", "street_text", "street_reference_number", 
> "Streets") 
>  
> The outcome is an error on compilation stating:
> Found [street_text] while searching for [An identifier]
>  
>  
> Where am I going wrong? 
>  
> Thanks
>  
> Ian
>  
>  
> 

> _______________________________________________
> MapInfo-L mailing list
> MapInfo-L@lists.directionsmag.com
> http://www.directionsmag.com/mailman/listinfo/mapinfo-l

_______________________________________________
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to