Dara,
I believe the way to get around this problem is by using an Alias variable.
Try this:
Dim objalias as Alias
Alias = tablename + ".obj"
fetch rec i from tablename
startX = centroidX(objalias)
startY = centroidY(objalias)
Good luck,
Gary.
"Thompson, Dara L. (RyTull)" wrote:
> I am having trouble figuring out how to use a user-defined file name with
> the CentroidX() and CentroidY() functions.
>
> In the following code, tablename is the user-defined file (declared as a
> global string variable).
>
> fetch rec i from tablename
> startX = centroidX(tablename.obj)
> startY = centroidY(tablename.obj)
>
> The error message is: "Found [.] while searching for [ ) ]"
>
> If the code is changed to:
> fetch rec i from tablename
> startX = centroidX(tablename)
> startY = centroidY(tablename)
>
> It compiles, but does not run in MapInfo. The following error occurs:
> "CentroidX argument 1 has invalid type"
>
> What am I missing? There must be a way to do this.
>
> TIA,
> Dara Thompson
> Senior Analyst
>
> --- Legal Disclaimer: The information contained in this communication may be
> confidential, is intended only for the use of the recipient named above, and
> may be legally privileged. If the reader of this message is not the
> intended recipient, you are hereby notified that any dissemination,
> distribution, or copying of this communication, or any of its contents, is
> strictly prohibited. If you have received this communication in error,
> please re-send this communication to the sender and delete the original
> message and any copy of it from your computer system. Thank you. ---
>
> _______________________________________________________________________
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, send e-mail to [EMAIL PROTECTED] and
> put "unsubscribe MapInfo-L" in the message body.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Gary Schwartz
Director of Software Development
Mapping Analytics
2 Graham Road West
Ithaca, NY 14850
(716) 271-6490
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.