473,432 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,432 software developers and data experts.

Arrays in Access.

KK
How can I find out the maximum or minimum values out of many values in
an array. I have an array in Access that loads upto 20 values depending
on a sql query. I would like to find out the min and max values from
this array. Is there like a function thats like Max(array()) that can
do that. Please let me know. Thank you
KK

Dec 14 '05 #1
21 18652
hmm... I"m a little slow... "based on a SQL query" is the key here.
(Missed that the first 3 times I read it.) If you sort in the query by
the field you want to get the min/max for, the min and max will be at
opposite ends of the recordset.

So if you use (assuming query sorts in ascending order)
rs.MoveFirst
lngMin=rs.Fields("OrderByField")
rs.MoveLast
lngMax=rs.fields("OrderByField")

kinda ugly, but if you pass two variables by Reference, then you can
effectively pass two values out of your function/sub.

Dec 14 '05 #2
KK
Interesting! let me think about this. Thanks for the response.

Dec 14 '05 #3
pietlin makes a good point. If you don't order the SQL query, you'll
need to a) sort your array (bubble sort would be efficient, since it's
only 20 elements), or b) write your array to a temporary table and run
a query off of the temporary table (which begs the question of "why
didn't you just sort the original query to start with?")

If your situation is different than I am understanding it to be, can
you show how your array gets its values from the SQL query? I.e., does
the SQL query feed into a form, and your array pick out data from the
form?

Dec 14 '05 #4
I am not aware of functions like that - too bad.
if you are building the arrays from a recordset sort the recordset
first before you build the array, then you can just get the first and
last values. array(0) and array(ubound(array).

if that is not an option, you are stuck with code. You didn't say
whether or not these were multi dimensional arrays or not - it changes
a little. Try something like this.

Function CreateArray()'this is for testing and to show how the
getminmax fn is used
Dim ary()
ary = Array(8, 6, 7, 5, 3, 0, 9)
MsgBox GetMinMax(ary)
MsgBox GetMinMax(ary, True) 'get max
End Function

Function GetMinMax(ary, Optional bGetMax As Boolean = False)
Dim iCounter
GetMinMax = ary(0) 'set to the first one so it's not empty
For iCounter = 0 To UBound(ary)
If (GetMinMax < ary(iCounter)) Xor bGetMax Then
GetMinMax = ary(iCounter)
End If
Next
End Function

Dec 14 '05 #5
By the way, if this is something you have to do often, looping through
an array is MUCH faster than looping through a recordset.

Dec 14 '05 #6
KK
Good points guys! Thanks.
Sorting before hand actually helped a bit.

Dec 14 '05 #7

"Steve" <th*********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
pietlin makes a good point. If you don't order the SQL query, you'll
need to a) sort your array (bubble sort would be efficient, since it's
only 20 elements), or b) write your array to a temporary table and run
a query off of the temporary table (which begs the question of "why
didn't you just sort the original query to start with?")

If your situation is different than I am understanding it to be, can
you show how your array gets its values from the SQL query? I.e., does
the SQL query feed into a form, and your array pick out data from the
form?

It looks like pietlin has the OP on track by sorting the data. In case that
doesn't work for him, however, I wanted to take exception to this
alternative. Since he only needs the min and max values from the array, he
really doesn't need to sort it. It would be more efficient and easier to
code to simply make a single pass through the array doing comparisons.

psuedocode:

minval = a(lbound)
maxval = a(lbound)
for i = lbound + 1 to ubound
if minval < a(i) then minval = a(i)
if maxval > a(i) then maxval = a(i)
next i

--
Randy Harris
I'm pretty sure I know everything that I can remember.

Dec 14 '05 #8
"Pachydermitis" <pr*******@gmail.com> wrote in
news:11*********************@g49g2000cwa.googlegro ups.com:
By the way, if this is something you have to do often, looping
through an array is MUCH faster than looping through a recordset.


But with a recordset, you wouldn't need to loop it to get the
answer.

Also, my bet is that the speed advantage of an array is going to
decrease the more rows you have.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 15 '05 #9
I may be mistaken, but the Microsoft code behind VB accessing a
recordset still has to loop through the database file's values to find
it's least and greatest. This code is done in some low level language
like C or Assembly so it is very fast. Not to mention you have all the
recodset management overhead that must be done before and after. To
make matters worse, the slowest recordset cursor tyeps are the ones
that support more than forwardonly movement.
An array resides in memory, so there is no file manipulation (unless
windows has wirtten it to a swap file) which is why it is so much
faster. Although you are right about the speed decreasing based on the
size of the array, the speed of accessing a recordset will also
decrease as the size of the recordset increases. I agree with you that
I would never recommend this for huge value lists, but for something
around 20, that he is using very often, it would be quite a bit faster.
Of course even if it's 100 times faster, the user probably won't ever
notice the difference between 1/1000 of second and 1/10 of a second. :)

Dec 15 '05 #10
I thought I would share my humble 2cents worth. Here is a generic query
that will populate an array.

Query1 --- Select * from Table1

populate the array with values from Query1

Sub PopulateArray()
Dim RS As DAO.Recordset, i As Integer
i=0
Set RS = CurrentDB.OpenRecordset("Query1")
'--or Set RS = CurrentDB.OpenRecordset("Select * From Table1")
Do while not RS.EOF
Redim Preserve array1(i)
array(i) = RS(0)
RS.MoveNext
i = i + 1
Loop
RS.Close
End Sub

To find the min and max values you can do this
Set RS = CurrentDB.OpenRecordset("Select Max(fldx) from Table1")

to find the Min value

Set RS = CurrentDB.OpendRecordset("Select Min(fldx) From Table1")

HTH
Rich
*** Sent via Developersdex http://www.developersdex.com ***
Dec 15 '05 #11
If one creates the array from an sql statement one can use joins and
subqueries to have maximum and minimum values appended to each record
and thus to each "row" in our array.
Also we can use GetRows to create the array; we must remember however
that in this two dimensional array the second element refers to the row
or record while the first refers to the field and that the array is
zero based (seemingly regardless of the Option Base setting, that is
a(7,41) refers to the value of the 8th field in the 42 record.

The code below gets all the field values from all the records from
tblCheques, appends a maximum fldAmount field, a minimum fldAmount
field, sorts not by fldAmount but by fldDate and slam dunks the results
into an array named a.

a(7,n) always returns the min amount and a(6,n) returns the max amount.
tblCheques has six fields.

Two subs: one for JET 35 and one for JET 40. 35 should work in 40 as
well, but 40 will not work in 35.

TTBOMK GetRows was a much used method in the X-Base days but is largely
ignored in both DAO and ADO. Too bad, it can be fast and powerful.

Ain't Access grand?

Sub temp40()
Dim a As Variant
Dim r As DAO.Recordset
Set r = DBEngine(0)(0).OpenRecordset( _
"SELECT * FROM (tblCheques c" _
& vbNewLine & "Left Join" _
& vbNewLine & "(SELECT MAX(fldAmount) AS maxAmount FROM tblCheques)
x" _
& vbNewLine & "ON c.fldAmount <= x.maxAmount)" _
& vbNewLine & "Left Join" _
& vbNewLine & "(SELECT MIN(fldAmount) AS minAmount FROM tblCheques
WHERE Nz(fldAmount,0) <> 0) n" _
& vbNewLine & "ON c.fldAmount <= n.minAmount" _
& vbNewLine & "ORDER BY c.fldDate", dbOpenDynaset)
With r
If Not .BOF Then
a = r.GetRows(.RecordCount)
Debug.Print a(.Fields.Count - 1, .RecordCount - 1)
Else
'whatever
End If
End With
Set r = Nothing
End Sub

Sub temp35()
Dim a As Variant
Dim r As DAO.Recordset
Set r = DBEngine(0)(0).OpenRecordset( _
"SELECT * FROM (tblCheques c" _
& vbNewLine & "Left Join" _
& vbNewLine & "[SELECT MAX(fldAmount) AS maxAmount FROM
tblCheques]. x" _
& vbNewLine & "ON c.fldAmount <= x.maxAmount)" _
& vbNewLine & "Left Join" _
& vbNewLine & "[SELECT MIN(fldAmount) AS minAmount FROM tblCheques
WHERE Nz(fldAmount,0) <> 0]. n" _
& vbNewLine & "ON c.fldAmount <= n.minAmount" _
& vbNewLine & "ORDER BY c.fldDate", dbOpenDynaset)
With r
If Not .BOF Then
a = r.GetRows(.RecordCount)
Debug.Print a(.Fields.Count - 1, .RecordCount - 1)
Else
'whatever
End If
End With
Set r = Nothing
End Sub

Dec 15 '05 #12
Or if you were using ADO you could do the following

SELECT
MAX(fldVal),
MIN(fldVal)
FROM
MyTable
WHERE
MyField = Condition

SELECT
fldVal
FROM
MyTable
WHERE
MyField = Condition
Pick up the maximum and minimum values from the recordset, the use
nextrecordset to get to the recordset used to fil lthe array.

--
Terry Kreft

"Lyle Fairfield" <ly***********@aim.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
If one creates the array from an sql statement one can use joins and
subqueries to have maximum and minimum values appended to each record
and thus to each "row" in our array.
Also we can use GetRows to create the array; we must remember however
that in this two dimensional array the second element refers to the row
or record while the first refers to the field and that the array is
zero based (seemingly regardless of the Option Base setting, that is
a(7,41) refers to the value of the 8th field in the 42 record.

The code below gets all the field values from all the records from
tblCheques, appends a maximum fldAmount field, a minimum fldAmount
field, sorts not by fldAmount but by fldDate and slam dunks the results
into an array named a.

a(7,n) always returns the min amount and a(6,n) returns the max amount.
tblCheques has six fields.

Two subs: one for JET 35 and one for JET 40. 35 should work in 40 as
well, but 40 will not work in 35.

TTBOMK GetRows was a much used method in the X-Base days but is largely
ignored in both DAO and ADO. Too bad, it can be fast and powerful.

Ain't Access grand?

Sub temp40()
Dim a As Variant
Dim r As DAO.Recordset
Set r = DBEngine(0)(0).OpenRecordset( _
"SELECT * FROM (tblCheques c" _
& vbNewLine & "Left Join" _
& vbNewLine & "(SELECT MAX(fldAmount) AS maxAmount FROM tblCheques)
x" _
& vbNewLine & "ON c.fldAmount <= x.maxAmount)" _
& vbNewLine & "Left Join" _
& vbNewLine & "(SELECT MIN(fldAmount) AS minAmount FROM tblCheques
WHERE Nz(fldAmount,0) <> 0) n" _
& vbNewLine & "ON c.fldAmount <= n.minAmount" _
& vbNewLine & "ORDER BY c.fldDate", dbOpenDynaset)
With r
If Not .BOF Then
a = r.GetRows(.RecordCount)
Debug.Print a(.Fields.Count - 1, .RecordCount - 1)
Else
'whatever
End If
End With
Set r = Nothing
End Sub

Sub temp35()
Dim a As Variant
Dim r As DAO.Recordset
Set r = DBEngine(0)(0).OpenRecordset( _
"SELECT * FROM (tblCheques c" _
& vbNewLine & "Left Join" _
& vbNewLine & "[SELECT MAX(fldAmount) AS maxAmount FROM
tblCheques]. x" _
& vbNewLine & "ON c.fldAmount <= x.maxAmount)" _
& vbNewLine & "Left Join" _
& vbNewLine & "[SELECT MIN(fldAmount) AS minAmount FROM tblCheques
WHERE Nz(fldAmount,0) <> 0]. n" _
& vbNewLine & "ON c.fldAmount <= n.minAmount" _
& vbNewLine & "ORDER BY c.fldDate", dbOpenDynaset)
With r
If Not .BOF Then
a = r.GetRows(.RecordCount)
Debug.Print a(.Fields.Count - 1, .RecordCount - 1)
Else
'whatever
End If
End With
Set r = Nothing
End Sub

Dec 15 '05 #13
The real question, Randy, would be "What is the compelling reason for moving
the results of a query into an array?" That is something that a procedural
programmer would do as a matter of course, but not necessarily a good
approach in a database application. It took many of us some time to change
our view from the procedural programming approach to "The Access Way", but
once we get accustomed to "The Access Way", database applications become
much easier.

I can think of several approaches to retrieving the Max and Min... a totals
query, the DMAX and DMIN functions, for example... in addition to the ways
already mentioned. And all a LOT easier than filling and sorting an array
(and likely as fast, or faster, to execute).

Larry Linson
Microsoft Access MVP
"Randy Harris" <ra***@SpamFree.com> wrote in message
news:3R*******************@newssvr14.news.prodigy. com...

"Steve" <th*********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
pietlin makes a good point. If you don't order the SQL query, you'll
need to a) sort your array (bubble sort would be efficient, since it's
only 20 elements), or b) write your array to a temporary table and run
a query off of the temporary table (which begs the question of "why
didn't you just sort the original query to start with?")

If your situation is different than I am understanding it to be, can
you show how your array gets its values from the SQL query? I.e., does
the SQL query feed into a form, and your array pick out data from the
form?

It looks like pietlin has the OP on track by sorting the data. In case
that
doesn't work for him, however, I wanted to take exception to this
alternative. Since he only needs the min and max values from the array,
he
really doesn't need to sort it. It would be more efficient and easier to
code to simply make a single pass through the array doing comparisons.

psuedocode:

minval = a(lbound)
maxval = a(lbound)
for i = lbound + 1 to ubound
if minval < a(i) then minval = a(i)
if maxval > a(i) then maxval = a(i)
next i

--
Randy Harris
I'm pretty sure I know everything that I can remember.

Dec 15 '05 #14
"Pachydermitis" <pr*******@gmail.com> wrote in
news:11**********************@z14g2000cwz.googlegr oups.com:
I may be mistaken, but the Microsoft code behind VB accessing a
recordset still has to loop through the database file's values to
find it's least and greatest. . . .
Eh? If you're using a recordset, you'd use GROUP BY and Max() and
Min(), so there wouldn't be an looping needed at all.
. . . This code is done in some low level
language like C or Assembly so it is very fast. Not to mention
you have all the recodset management overhead that must be done
before and after. To make matters worse, the slowest recordset
cursor tyeps are the ones that support more than forwardonly
movement. An array resides in memory, so there is no file
manipulation (unless windows has wirtten it to a swap file) which
is why it is so much faster. Although you are right about the
speed decreasing based on the size of the array, the speed of
accessing a recordset will also decrease as the size of the
recordset increases. I agree with you that I would never
recommend this for huge value lists, but for something around 20,
that he is using very often, it would be quite a bit faster.
SQL aggregate functions will always be faster than looping either a
recordset or an array.
Of course even if it's 100 times faster, the user probably won't
ever notice the difference between 1/1000 of second and 1/10 of a
second. :)


That's not the point. For any process where it's theoretically
possible for the number of items to change, You sould always use
the
most scalable approach, even if right now there is no noticeable
speed increase.

[this is not at all a contradiction of my perennial point that not
all performance optimizations have a real-world effect]

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 15 '05 #15
Rich P <rp*****@aol.com> wrote in
news:Aa**************@news.uswest.net:
To find the min and max values you can do this
Set RS = CurrentDB.OpenRecordset("Select Max(fldx) from Table1")

to find the Min value

Set RS = CurrentDB.OpendRecordset("Select Min(fldx) From Table1")


Er, why not:

Set RS = CurrentDB.OpendRecordset("Select Min(fldx), Max(fldx) From
Table1")

That will get you both values in a single recordset.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 15 '05 #16
"Terry Kreft" <te*********@mps.co.uk> wrote in
news:G-********************@karoo.co.uk:
Or if you were using ADO you could do the following

SELECT
MAX(fldVal),
MIN(fldVal)
FROM
MyTable
WHERE
MyField = Condition

SELECT
fldVal
FROM
MyTable
WHERE
MyField = Condition

Pick up the maximum and minimum values from the recordset, the
use nextrecordset to get to the recordset used to fil lthe array.


But why would you need to do that if you're looping the second
recordset to populate an array?

My understanding was that an array was the needed structure here,
and the information about the Min() and Max() values isn't stored
in the array explicitly.

It seems to me that knowing that the array is sorted (and will stay
that way), you always know that the 1st value in it is the Min()
and the last item the Max().

I fail to see how this is problematic, though it assumes that the
array is sorted. As many people have pointed out, if the array is
populated from a SQL resultset, then it is a piece of cake to
retreive it sorted.

So, I can't see what point retrieving the ADO multiple recordset
has in this discussion (though, of course, it's a useful technique
in some cases).

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 15 '05 #17
I raised it as a possibility because it is a serious contender to meet the
business requirements and following the recent discussion is topical.

It's a serious contender because
1) If I were populating an array from a recordset I would use the
GetRows method not iterate through the recordset to do so.
2) It may not be convenient to sort the recordset in the sequence
required to find the max value and the min value by the method you're
proposing.

For example if the requirement was to get the following recordset.

SELECT
cust_name, inv_val
FROM
customers
INNER JOIN
invoices
ON
customers.cust_code = invoices.cust_code
WHERE
cust_code = 'DWF'
ORDER BY
inv_date

but there was also a requirement to find the minimum and the maximum invoice
value, then ordering the recordset by the invoice amount breaks the
requirement.

However

SELECT
MAX(inv_val),
MIN(inv_val)
FROM
invoices
WHERE
cust_code = 'DWF'

SELECT
cust_name, inv_val
FROM
customers
INNER JOIN
invoices
ON
customers.cust_code = invoices.cust_code
WHERE
cust_code = 'DWF'
ORDER BY
inv_date

Fits the requirements.
--
Terry Kreft

"David W. Fenton" <XX*******@dfenton.com.invalid> wrote in message
news:Xn**********************************@216.196. 97.142...
"Terry Kreft" <te*********@mps.co.uk> wrote in
news:G-********************@karoo.co.uk:
Or if you were using ADO you could do the following

SELECT
MAX(fldVal),
MIN(fldVal)
FROM
MyTable
WHERE
MyField = Condition

SELECT
fldVal
FROM
MyTable
WHERE
MyField = Condition

Pick up the maximum and minimum values from the recordset, the
use nextrecordset to get to the recordset used to fil lthe array.


But why would you need to do that if you're looping the second
recordset to populate an array?

My understanding was that an array was the needed structure here,
and the information about the Min() and Max() values isn't stored
in the array explicitly.

It seems to me that knowing that the array is sorted (and will stay
that way), you always know that the 1st value in it is the Min()
and the last item the Max().

I fail to see how this is problematic, though it assumes that the
array is sorted. As many people have pointed out, if the array is
populated from a SQL resultset, then it is a piece of cake to
retreive it sorted.

So, I can't see what point retrieving the ADO multiple recordset
has in this discussion (though, of course, it's a useful technique
in some cases).

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Dec 16 '05 #18
"Terry Kreft" <te*********@mps.co.uk> wrote in
news:Fg********************@karoo.co.uk:
For example if the requirement was to get the following recordset.

SELECT
cust_name, inv_val
FROM
customers
INNER JOIN
invoices
ON
customers.cust_code = invoices.cust_code
WHERE
cust_code = 'DWF'
ORDER BY
inv_date

but there was also a requirement to find the minimum and the
maximum invoice value, then ordering the recordset by the invoice
amount breaks the requirement.


Well, sure, if you change the scope of the original problem, then,
yes, there are any number of other possible answers.

But the original question was about a 1-dimensional array and
finding the Min() and Max() of that array. In that case, an ordered
recordset for populating the array would do just fine.

Your example isn't responsive to that as all, because you're getting
a Min/Max of data other than what is stored in the ordered array.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 16 '05 #19
Hmm, I have so many responses to this post, but I'll restrict myself to the
following.

Specific responses
-----------------------
1) The original post didn't state a 1-dimensional array although it is
implied.
2) The "scope" of the problem was changed way back as soon as people started
talking about ordering the recordset rather than as the OP requested working
with the array.
3) I believe you were the first person to raise Min/Max in this thread which
moved the discussion even further from the OPs question.
4) Changing the scope of the problem is frequently the way you need to go in
order to acheive a more efficient or generic method for dealing with the
problem.
5) If you use the same selection criteria in both select statements then you
are getting the summarised results of the required recordset in the first
statement and the resultset required in the second, without being
constricted by the requirement to fill the array in a sequence necessary to
pick up the Min and Max values.
General response
---------------------
The idea of posting to a newsgroup is not necessarily with the intention of
getting an answer to the specific question asked, by the very nature of
newsgroups a discussion will take place and a number of alternative
solutions will be presented. If a person wants an answer to a specific
question then they are losing out on one of the strongest aspects of posting
to NGs.

--
Terry Kreft

"David W. Fenton" <XX*******@dfenton.com.invalid> wrote in message
news:Xn**********************************@127.0.0. 1...
"Terry Kreft" <te*********@mps.co.uk> wrote in
news:Fg********************@karoo.co.uk:
For example if the requirement was to get the following recordset.

SELECT
cust_name, inv_val
FROM
customers
INNER JOIN
invoices
ON
customers.cust_code = invoices.cust_code
WHERE
cust_code = 'DWF'
ORDER BY
inv_date

but there was also a requirement to find the minimum and the
maximum invoice value, then ordering the recordset by the invoice
amount breaks the requirement.


Well, sure, if you change the scope of the original problem, then,
yes, there are any number of other possible answers.

But the original question was about a 1-dimensional array and
finding the Min() and Max() of that array. In that case, an ordered
recordset for populating the array would do just fine.

Your example isn't responsive to that as all, because you're getting
a Min/Max of data other than what is stored in the ordered array.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Dec 17 '05 #20
"Terry Kreft" <te*********@mps.co.uk> wrote in
news:Vx********************@karoo.co.uk:
The idea of posting to a newsgroup is not necessarily with the
intention of getting an answer to the specific question asked, by
the very nature of newsgroups a discussion will take place and a
number of alternative solutions will be presented. If a person
wants an answer to a specific question then they are losing out on
one of the strongest aspects of posting to NGs.


Well, sure, I agree with this. But I think you could have been more
clear about why you were proposing retreiving two recordsets, as in
my head I was still thinking of the ordered 1-dimensional array, and
I'm sure I'm not the only one who was still thinking that way.

It's really a matter of framing: when you're changing the topic,
broadening the discussion or reframing the question, it's best to
say so.

One of the faculty in the Music Department at NYU has a canned
question at all dissertation defenses. It always begins: "So, I know
it's the dissertation you *didn't* write, *but*. . .", and it seems
to me that some kind of preface like that could make the discussion
less confusing.

I think I almost always do that myself when I'm branching out from
the original topic, but perhaps I'm elliptical about it, too.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 17 '05 #21
Oh I don't know, seems that if you read through the thread there's a fairly
logical progression towards my post.

KK - I want the min/max values from an array filed from a recordset
Piet Linden - Order the recordset so the min/max are first/last values on
recordset
Lyle - append min/ max values to records in recordset
TK - use multi-dimensional recordset.

I realise that Piet Linden's message was on a separate branch of the thread
but it still precedes Lyles so the sequence is valid.

Now there were a number of other posts with reasonable suggestions but these
were the ones which stuck in my mind as the progression towards my original
post.
--
Terry Kreft

"David W. Fenton" <XX*******@dfenton.com.invalid> wrote in message
news:Xn**********************************@127.0.0. 1...
"Terry Kreft" <te*********@mps.co.uk> wrote in
news:Vx********************@karoo.co.uk:
Te idea of posting to a newsgroup is not necessarily with the
intention of getting an answer to the specific question asked, by
the very nature of newsgroups a discussion will take place and a
number of alternative solutions will be presented. If a person
wants an answer to a specific question then they are losing out on
one of the strongest aspects of posting to NGs.


Well, sure, I agree with this. But I think you could have been more
clear about why you were proposing retreiving two recordsets, as in
my head I was still thinking of the ordered 1-dimensional array, and
I'm sure I'm not the only one who was still thinking that way.

It's really a matter of framing: when you're changing the topic,
broadening the discussion or reframing the question, it's best to
say so.

One of the faculty in the Music Department at NYU has a canned
question at all dissertation defenses. It always begins: "So, I know
it's the dissertation you *didn't* write, *but*. . .", and it seems
to me that some kind of preface like that could make the discussion
less confusing.

I think I almost always do that myself when I'm branching out from
the original topic, but perhaps I'm elliptical about it, too.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Dec 18 '05 #22

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

34
by: Christopher Benson-Manica | last post by:
If an array is sparse, say something like var foo=; foo=4; foo='baz'; foo='moo'; is there a way to iterate through the entire array? --
50
by: jacob navia | last post by:
As everybody knows, the C language lacks a way of specifying bounds checked arrays. This situation is intolerable for people that know that errors are easy to do, and putting today's powerful...
5
by: chella mani | last post by:
hi all, I am developing a tool for scientific application which must be time and memory efficient,my tool uses 1D,2D and 3D arrays. Is it a good practice to use 3D arrays in applications or I...
8
by: masood.iqbal | last post by:
All this time I was under the illusion that I understand the concept of multi-dimensional arrays well ---- however the following code snippet belies my understanding. I had assumed all along...
11
by: truckaxle | last post by:
I am trying to pass a slice from a larger 2-dimensional array to a function that will work on a smaller region of the array space. The code below is a distillation of what I am trying to...
1
by: Michael Fitzpatrick | last post by:
Transferring arrays from C DLL's to VB.Net I have a DLL written in C. This DLL reads a text file and creates a several very large arrays, 500,000 points and even larger. I would like the get the...
10
by: madhura | last post by:
Hello, I have a problem with 2-d arrays and scanf function. I have wriitten a code in which i am accepting values in 1-d arrays int a,i; for(i=0;i<3;i++) scanf("%d",a+i); when I print the...
18
by: ballpointpenthief | last post by:
Hello, I don't seem to be allowed to have arrays of bit fields? Are there any ways round this? And what about good ways? I tried typedef quickly with no luck. Surely I should be allowed to do...
152
by: vippstar | last post by:
The subject might be misleading. Regardless, is this code valid: #include <stdio.h> void f(double *p, size_t size) { while(size--) printf("%f\n", *p++); } int main(void) { double array = { {...
0
by: datapata | last post by:
Hi I have some C++ code that I need to access from Python. I don't need to access any classes or anything, just a couple of functions that take one array as input and produce another array as...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...
0
isladogs
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.