My best understanding/explanation is that "TableName.obj" refers to a column and not to a single specific object. The alias will get the value of that column for a specific object (=row). As some functions return information about one specific object, the alias is the only way to have the function perform its task.
 
But do not push me any further on the theory of "alias" and its applications, that is all I could come up with.
 

Jacques Paris

e-mail                alternate
     [EMAIL PROTECTED]   [EMAIL PROTECTED]

paris PC Consult (mainly MapInfo app.)
     www.total.net/~rparis/gisproducts.htm

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jack Wierzchowski
Sent: October 31, 1999 3:22 PM
To: [EMAIL PROTECTED]
Subject: MI use of Alias variables

Hi All,

Can someone explain why one has to use alias variables in the simple snippet below to make it work? When I tried to use :

start_x = CentroidX (sTableName.obj)

start_y = CentroidY(sTableName.obj)

the program generates error messages.

Thanks

Jack

Here is the snippet:

Dim start_x, start_y As Float

Dim a as Alias

Dim b as Alias

Dim  nrows, crows as smallint

Dim szFullTableName, sTableName as String

szFullTableName = FileOpenDlg("","","TAB","Open Table with Point Objects")

Open Table szFullTableName

sTableName = PathToTableName$(szFullTableName)

crows=1

nrows = TableInfo(sTableName, TAB_INFO_NROWS)

Do While (crows <= nrows)

Fetch Rec crows From sTableName

a = sTableName + ".obj"

start_x = CentroidX (a)

start_y = CentroidY(a)

' this code works

Reply via email to