I have a multidimensiona l array with 5 keys. I need to perform a
alpha sort on the 3rd key. Does anyone have an example on how to do
this?
Here is an example of what my array consists of:
mArray(i,0) = '2007-05-02"
mArray(i,1) = "6:00pm"
mArray(i,2) = "TEXT TEXT TEXT" <------------------ NEED TO DO ALPHA
SORT ON THIS KEY ----------------<<
mArray(i,3) = 6
mArray(i,4) = 4
Thanks,
Steve 2 4782 gl****@gmail.co m wrote:
I have a multidimensiona l array with 5 keys. I need to perform a
alpha sort on the 3rd key. Does anyone have an example on how to do
this?
Here is an example of what my array consists of:
mArray(i,0) = '2007-05-02"
mArray(i,1) = "6:00pm"
mArray(i,2) = "TEXT TEXT TEXT" <------------------ NEED TO DO ALPHA
SORT ON THIS KEY ----------------<<
mArray(i,3) = 6
mArray(i,4) = 4
Put the data into an ad hoc recordset and use its Sort method:
dim rs
Const adDBTimeStamp = 135
Const adVarChar = 200
Const adInteger = 3
set rs=createobject ("adodb.records et")
With rs.Fields
.Append "fDate",adDBTim eStamp
.Append "fTime",adDBTim eStamp
.Append "fText",adVarCh ar,50
.Append "fNum1",adInteg er
.Append "fNum2",adInteg er
End With
rs.Open
'loop through the array:
rs.AddNew Array(mArray(i, 0),mArray(i,1), mArray(i,2),mAr ray(i,3), _
mArray(i,4))
'etc.
'end loop
rs.Sort "fText"
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
On May 25, 2:27 pm, "Bob Barrows [MVP]" <reb01...@NOyah oo.SPAMcom>
wrote:
glb...@gmail.co m wrote:
I have a multidimensiona l array with 5 keys. I need to perform a
alpha sort on the 3rd key. Does anyone have an example on how to do
this?
Here is an example of what my array consists of:
mArray(i,0) = '2007-05-02"
mArray(i,1) = "6:00pm"
mArray(i,2) = "TEXT TEXT TEXT" <------------------ NEED TO DO ALPHA
SORT ON THIS KEY ----------------<<
mArray(i,3) = 6
mArray(i,4) = 4
Put the data into an ad hoc recordset and use its Sort method:
dim rs
Const adDBTimeStamp = 135
Const adVarChar = 200
Const adInteger = 3
set rs=createobject ("adodb.records et")
With rs.Fields
.Append "fDate",adDBTim eStamp
.Append "fTime",adDBTim eStamp
.Append "fText",adVarCh ar,50
.Append "fNum1",adInteg er
.Append "fNum2",adInteg er
End With
rs.Open
'loop through the array:
rs.AddNew Array(mArray(i, 0),mArray(i,1), mArray(i,2),mAr ray(i,3), _
mArray(i,4))
'etc.
'end loop
rs.Sort "fText"
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Thanks BOB ... that worked!!!
- Steve This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Brian |
last post by:
I have an array like this:
$events = array(
array(
'2003-07-01',
'Event Title 1',
'1' //ID Number (not unique)
),
array(
'2003-07-02',
|
by: markus |
last post by:
I usually store info in arrays using field names
$array='Germany',
$array="GE";
$array='United Sates"
$array="US";
$array='France"
$array='FR"
|
by: Federico G. Babelis |
last post by:
Hi All:
I have this line of code, but the syntax check in VB.NET 2003 and also in
VB.NET 2005 Beta 2 shows as unknown:
Dim local4 As Byte
Fixed(local4 = AddressOf dest(offset))
CType(local4, Short) = CType(src, Short)
|
by: success_ny |
last post by:
Does anyone have a code snippet to compare those values so I can sort
the array of alpha-numeric values that include both characters and
integers in it?
I.e., if we have values like 4236 and 123234, I want 4236 to be second
because 4 is bigger than 1 rather than using the numeric comparison.
The strings can include character values and...
|
by: Charles Banas |
last post by:
i've got an interesting peice of code i'm maintaining, and i'd like to
get some opinions and comments on it, hopefully so i can gain some
sort of insight as to why this works.
at the top of the function (which was translated from Fortran code),
among other heinous and numerous declarations, is this bit:
static float bbuff;
static int...
| |
by: Joshua Russell |
last post by:
Hi,
I wish to parse an XML file into some sort or array or multidimensional storage. The XML file is as follows (without any parent tags just to give you an idea of the structure)...
<Ship Name="Disrupter" Class="CC" PrimaryTarget="CR" BattleOrder="1" Guns="5" Power="2"></Ship>
<Ship Name="Zealot" Class="CR" PrimaryTarget="CC" BattleOrder="2"...
|
by: Mark Smith |
last post by:
I'm trying to copy data from a 1D array to a 2D array.
The obvious thing doesn't work:
int twoDee = new int;
int oneDee = new int { 1, 2 };
Array.Copy(oneDee, 2, twoDee, 2, 2);
This causes a RankException. But the MSDN documentation says:
When copying between multidimensional arrays, the array
|
by: Rehceb Rotkiv |
last post by:
Hello everyone,
can I sort a multidimensional array in Python by multiple sort keys? A
litte code sample would be nice!
Thx,
Rehceb
|
by: Slain |
last post by:
I need to convert a an array to a multidimensional one. Since I need
to wrok with existing code, I need to modify a declaration which looks
like this
In the .h file
int *x;
in a initialize function:
x = new int;
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |