473,698 Members | 2,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I create a multi-dimensional hash table?

74 New Member
Hi,

I'm new to ruby and i've been experimenting on different ways on how to do this, but sadly nothing is working. I would like to create a multi-dimensional hash table in which i can access my members so that the output looks like this

[Key] [value1] [value2] [value3] [value4]
key 1 some val some val some val some val
key 2 some val some val some val some val
key 3 some val some val some val some val
key 4 some val some val some val some val
key 5 some val some val some val some val
. . . . .
. . . . .
. . . . .
n n n n n

this hash table needs to be created in a loop. How would i do this?

Additional information: i need to use a has table because i absolutely need to index value1, value2, value3, value4 by key

any examples or documentation would help as i've tried google and i cant find anything relevant
Jun 8 '11 #1
1 3628
improvcornartist
303 Recognized Expert Contributor
Would a hash of arrays work?
Jun 9 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2107
by: JohnFol | last post by:
I know Windows / SQL etc can utilise multiple processors. In the good old days of coding, you simply wrote the .EXE and Windows would run it on a single processor (or a given processor for multi-processor machines) I know also that threads exist, but am having a few problems understanding how they are split across processors so here is an easy example. I have a VB.Net written application that is processor intensive. It has not been...
4
1723
by: news.microsoft.com | last post by:
I am moving a classic ASP app to ASP.NET (c#). It is a series of pages that collect data, validtae the data and move to the next form. I used response.redirect in the classic ASP app but want to know what options I have for an ASP.NET app. I could use pannels, but that would require a rather large set of viewstate data. I have about 15 forms, each with about 5-10 data elements. I could also use server.transfer I guess. My question is,...
1
1404
by: Grahammer | last post by:
Is it possible to create a multi element property in VB.Net? Something similar to the "Location" or "Size" property. Each of these has two elements. I'm trying to create an IMAGE property that has four different elements. One for each state of a button. I would set the image for a normal button like this: MyButton.ButtonImage(ButtonStates.Normal) = imgButtons.Images(0)
2
2308
by: | last post by:
I need to assign a multiline string to a textbox in design time, my problem is that strings cannot be on more than one line in the editor, even the _ at the end of a line doesn't work with string, so how can I do this? (I need it to store some readme instructions in my program, but I want them to be part of the exe and not in another txt file. tia.
5
2135
by: Richard Lewis Haggard | last post by:
I am trying to create multi-dimensioned arrays in conventional ASP pages and pass these arrays as arguments to functions that are in a C# interop assembly. ASP complains because it doesn't recognize that the created array is the same as the declared interface argument. The C# function is expecting to receive a 2 dimensioned array and is declared like this: public object InteropFunc( string s1, object arValues ); What should the ASP...
19
2331
by: Brett Romero | last post by:
Here's a table of data I'm putting into a collection: CodeId CodeGroup CodeSubGroup Type 1 K K.1 Shar1 2 K K.1 MD5 3 J J.2 Shar1 I want to get the data in two ways: Codes codes;
4
1646
by: Laurence | last post by:
Hi folks, Who knows how to create multi-location/global views? Could you show me some examples? Thanks in advance, Laurence
1
1616
by: =?Utf-8?B?Umljaw==?= | last post by:
Is there a way to create a windows form in c# 2005 with form size larger than the Maximum height of 876? If not then how do I create a multi-page contineous form?
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
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, 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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9028
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8861
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 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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4369
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3046
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
2
2330
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
bsmnconsultancy
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.