Jack,
 
The answer is that, essentially, .obj is not a property of a string variable.  The Alias variable type understands that it may hold string, numeric, date, object, etc data.  MS VB uses the 'variant' type for the same sorts of casting.
 
Hope this helps.
 
Sam Kome
Sage Software, Inc
 
-----Original Message-----
From: Jack Wierzchowski <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Sunday, October 31, 1999 4:37 PM
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