Title: Meddelelse
Hi Ian,
 
You have to write ByVal before each variable /parameter definition in order to pass text strings to the sub.
 
Furthermore you have the possibility to write several parameters of the same type before declaring the variable type i.e.:
 
Declare Sub Table_to_Array( byval sTabname, byval sCol_1, byval sCol_2, byval sType as string)
 

Best regards

Jacob K. Jørgensen
Engineer, M.SC. in GeoInformatics
__________________________________________

Watertech
Soendergade 53
DK-8000 Aarhus C

Phone: +45 8732 2020
Direct phone: +45 8732 2078
Fax: +45 8732 2021


[EMAIL PROTECTED]
www.watertech.dk

-----Oprindelig meddelelse-----
Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Ian Robertson
Sendt: 19. juli 2006 13:28
Til: MapInfo-L@lists.directionsmag.com
Emne: [MI-L] Problem with parameters in Sub

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

Reply via email to