1

I'd like to be able to query an array (multi and single dimensional ) with something like SQL. Is there a way to do this?

It just seems extraordinarily wasteful to step through it one record at a time.

Keng
  • 52,011
  • 32
  • 81
  • 111

2 Answers2

2

Nope. Do you wasteful in terms of having to write the loop, or performance wise? I'd expect heaping a layer of abstraction over the array would hinder performance.

If you need to search your arrays in something other than linear time (ie., one at a time), you'll need to organize them so that you can so a binary search over them (or any number of other algorithms).

Dana
  • 32,083
  • 17
  • 62
  • 73
  • Rats....I come from a DB background and arrays look so much like a db that I was hoping there was something out there. – Keng Jan 21 '10 at 21:12
2

A disconnected recordset might suit: How do I sort arrays using vbscript?

Community
  • 1
  • 1
Fionnuala
  • 90,370
  • 7
  • 114
  • 152