I know the problem is solved for now, but maybe it would have worked, if you 
were using an alias variable to hold the column names:

Dim     vName, vLongname, vLatname As String,
        aLong, aLat As Alias

'Here the user selects the table and the columns and the values are assigned 
the string variables


        aLong   = vName & "." & vLongname
        aLat    = vName & "." & vLatname
        Update vName 
                Set obj = CreatePoint(aLong,aLat)


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: Niemiec, Neal [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 18, 2004 9:32 PM
To: '[EMAIL PROTECTED]'
Subject: MI-L RE: Create Points and Referencing Columns


Ok, 

 

Everybody responded with the fact that I should be using a float or decimal in 
place of the column referencing for CreatePoint. However, using a string 
variable and appending the column number to "col" for referencing the column 
worked. 

 

 

vName = <table>

vLong = <Columnnumber>

vLat = <Columnnumber>

Dim vCommand as string

 

vCommand = "Update "+vName+" Set obj = CreatePoint(col"+vLong+",col"+vLat+")"

Run command vCommand

 

 

 

-----Original Message-----
From: Niemiec, Neal 
Sent: Thursday, November 18, 2004 12:50 PM
To: '[EMAIL PROTECTED]'
Subject: Create Points and Referencing Columns

 

OK, 

 

This is frustrating . . . I am trying to create points from a flat file that is 
mappable. However, I am using variables for the column names as I am having the 
user select the columns to use. The syntax is something like
this:

 

Update <table> 

Set obj = CreatePoint(xcoord, ycoord)

 

In the Mapbasic example is has the names of the columns, however, when I input 
the variable names such as:

 

Update vName 

Set obj = CreatePoint(vLongname,vLatname)

 

I get the following error:

 

Could not convert data. CreatePoint: argument 1 has invalid type

 

The variables are strings, what am I missing

 

 

 

Any help appreciated

 

NTN


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

Reply via email to