Stephen,
I'm not sure there is a way to do it without type
conversion (and there may be) but, it is not that hard to go through the
string conversion...I wrote this macro to sort a 1-dimension
list....so if it is going to be multi-dimensional you will need to adjust
indexes a bit but, that will be easy...just put the macro in your code somewhere
and call it where you would have used SortArray() in the first place (i.e.
Stephens_array = RunMacro("sort_insensitive",Stephens_array)....hope this
helps...Dave
//SORTING
1-DIMENSIONAL LIST WITH DIFFERENT CASES
Macro "sort_insensitive" (your_array)
Macro "sort_insensitive" (your_array)
a1 =
your_array
for i = 1 to a1.length do
a1[i] = {a1[i],i}
end
for i = 1 to a1.length do
a1[i] = {a1[i],i}
end
for i = 1 to
a1.length do
a2 = a2+{{Upper(a1[i][1]),a1[i][2]}}
end
a2 = a2+{{Upper(a1[i][1]),a1[i][2]}}
end
a2=sortarray(a2)
for i = 1 to
a1.length do
chk = a2[i][2]
val = 0
for j = 1 to a1.length do
val = a1[j][2]
if val = chk then do
goto match
end
end
match:
a3 = a3+{a1[j][1]}
end
your_array = a3
//showarray(your_array)
Return(your_array)
endmacro
chk = a2[i][2]
val = 0
for j = 1 to a1.length do
val = a1[j][2]
if val = chk then do
goto match
end
end
match:
a3 = a3+{a1[j][1]}
end
your_array = a3
//showarray(your_array)
Return(your_array)
endmacro
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of sjones_sc
Sent: Sunday, February 26, 2006 8:59 AM
To: [email protected]
Subject: [Maptitude] SortArray() Alphabetical Issues
layer names) alphabetically, BUT, it first sorts the layers with Upper
Case names A-Z, then it sorts the layers with lower case names A-Z.
How can I (without a series of string conversions) get it to disregard
the capitalization and simply sort them all alphabetically?
Thanks,
Stephen
SPONSORED LINKS
| Geographic information systems | Geography game | Geography game for kid |
| Geography |
YAHOO! GROUPS LINKS
- Visit your group "Maptitude" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
