"Alias" is a MIPro specific invention designed to enable indirect column references. 
Nothing more, nothing less.
So it really doesn't make any sense to store them in arrays or otherwise, since 
they're not data, just redirections.
And they are certainly not warranted in SELECT statements etc.

So instead, save the column names in an array, and use a single alias variable 
whenever you need to make a variable column
reference.
And just use the column names when you need to select, and use a command string if the 
list is of variable length.

myColumnList(1) = "col1"
myColumnList(2) = "col6"
myColumnList(3) = "col15"

Select myColumnList(1),myColumnList(2),myColumnList(3),
  Sum(ProportionOverlap(BaseTable.obj,SubTable.obj)*100),
  Sum(ProportionOverlap(SubTable.obj,BaseTable.obj)*100)
  From BaseTable,SubTable
  Where BaseTable.obj Intersects SubTable.obj
  Into ResultsTable

or

CommandString = "Select "+myColumnList(1)+","+myColumnList(2)+","+myColumnList(3)+","
  +"Sum(ProportionOverlap(BaseTable.obj,SubTable.obj)*100),"
  +"Sum(ProportionOverlap(SubTable.obj,BaseTable.obj)*100)"
  +" From BaseTable,SubTable"
  +" Where BaseTable.obj Intersects SubTable.obj"
  +" Into ResultsTable"
Run Command CommandString

Best regards/Med venlig hilsen
Lars V. Nielsen
GisPro, Denmark
http://www.gispro.dk/
http://hjem.get2net.dk/lars-online/
WGS84: 10.20'40"E 55.20'20"N
----- Original Message -----
From: "Canfield, Andrew" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 18, 2002 11:36 PM
Subject: MI-L MapBasic Alias Array question


> I have an array of alias variables each value in the array is a column name
> in a table. I need to do a proportion overlap query and also include the
> columns in that array which the user has selected from a popup control of
> the column names. How do I do it? For example:
>
> if aliasColumnList represented these values which the user would have
> randomly selected:
>
> aliasColumnList(1) = mytable.col1
> aliasColumnList(2) = mytable.col6
> aliasColumnList(3) = mytable.col15
>
> How do I get the following to work?
>
> Select aliasColumnList,
> Sum(ProportionOverlap(BaseTableobj,SubTableobj)*100),
> Sum(ProportionOverlap(SubTableobj,BaseTableobj)*100)
> From BaseTable,SubTable
> Where BaseTableobj Intersects SubTableobj
> Into ResultsTable
>
> Any help would be greatly appreciated
>


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

Reply via email to