Re: MI LAYER_INFO_NAME and ObjectInfo

2000-08-14 Thread Eric Frost / HR and Associates, Inc.

Yannick Leduc,

That works perfectly...thanks for such a fast
response!

Eric
- Original Message -
From: "Leduc, Yannick" [EMAIL PROTECTED]
To: "'Eric Frost / HR and Associates, Inc.'" [EMAIL PROTECTED]
Sent: Monday, August 14, 2000 12:41 PM
Subject: RE: MI LAYER_INFO_NAME and ObjectInfo


Hi Eric,

try this:

Include "MapBasic.Def"

Dim szLayerName As String
szLayerName = LayerInfo(FrontWindow(), 1, LAYER_INFO_NAME)

Fetch First From szLayerName

Dim obj_type As Integer
Dim objt As object
dim Alias_obj As Alias

alias_obj = szLayerName+".obj"
objt = alias_obj
obj_type = ObjectInfo(objt, OBJ_INFO_TYPE)

When I use a Fetch, I define an alias that will point the object, and then,
I put the object in a variable. It works. I hope it will do the same for
you.

Good luck

Yannick Leduc


-Message d'origine-
De : Eric Frost / HR and Associates, Inc.
[mailto:[EMAIL PROTECTED]]
Envoyé : 14 août, 2000 13:09
À : [EMAIL PROTECTED]
Objet : MI LAYER_INFO_NAME and ObjectInfo



What is wrong with this code:

Include "MapBasic.Def"

Dim szLayerName As String
szLayerName = LayerInfo(FrontWindow(), 1, LAYER_INFO_NAME)

Fetch First From szLayerName

Dim obj_type As Integer
obj_type = ObjectInfo(szLayerName.obj, OBJ_INFO_TYPE)

I have tried all sorts of work-arounds like assigning the object to an
object variable and Run Command but have not hit on the solution.

Thanks in advance!

--
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

--
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]



RE: MI LAYER_INFO_NAME and ObjectInfo

2000-08-14 Thread Warren Vick, Europa Technologies Ltd.

Hello Eric,

You need to use an "alias". Although you have assigned szLayerName a table
name, you cannot access .obj from it. The rule-of-thumb is that if you have
a variable containing a table name, you need to use an alias to get any
fields from that table. When an alias variable is encountered, it is
interpreted literally by MapBasic. The following should work:

Include "MapBasic.Def"

Dim szLayerName As String
dim ObjAlias as alias

szLayerName = LayerInfo(FrontWindow(), 1, LAYER_INFO_NAME)
ObjAlias = szLayerName+".obj"

Fetch First From szLayerName

Dim obj_type As Integer
obj_type = ObjectInfo(ObjAlias, OBJ_INFO_TYPE)

Regards,
Warren Vick
Europa Technologies Ltd, U.K.
http://www.europa-tech.com

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Eric Frost / HR and
 Associates, Inc.
 Sent: Monday, August 14, 2000 6:10 PM
 To: [EMAIL PROTECTED]
 Subject: MI LAYER_INFO_NAME and ObjectInfo



 What is wrong with this code:

 Include "MapBasic.Def"

 Dim szLayerName As String
 szLayerName = LayerInfo(FrontWindow(), 1, LAYER_INFO_NAME)

 Fetch First From szLayerName

 Dim obj_type As Integer
 obj_type = ObjectInfo(szLayerName.obj, OBJ_INFO_TYPE)

 I have tried all sorts of work-arounds like assigning the object to an
 object variable and Run Command but have not hit on the solution.

 Thanks in advance!

 --
 To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
 "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]


--
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]