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

Home Posts Topics Members FAQ

dictionary within dictionary

Fox
Hi,

I am working on a project which
used dictionaries. I am having
to remake part of this and have
no experience with the
scripting dictionary.

I need to see how to create multiple
dictionaries within one dictionary.
Can someone point me to some
reading materials on this where I
might see an example as well?

Thanks,
Fox
Jul 22 '05 #1
5 2744
Dictionaries cannot contain dictionaries. You can have an array of
dictionaries though. But why are you using all these dictionaries? Do you
work at an insurance company in SE Pennsylvania, by chance?

Ray at work

"Fox" <fox @ connexions.net> wrote in message
news:Ox******** ******@TK2MSFTN GP14.phx.gbl...
Hi,

I am working on a project which
used dictionaries. I am having
to remake part of this and have
no experience with the
scripting dictionary.

I need to see how to create multiple
dictionaries within one dictionary.
Can someone point me to some
reading materials on this where I
might see an example as well?

Thanks,
Fox

Jul 22 '05 #2
Fox
Good question.
I am redoing a site for an event which requires
a somewhat complex registration. One option is
a family option. This means they can register
a number of competitors on the same credit card.
So I need to keep track of the info for each of the
registering competitors, during that session, until
they check out and submit the credit card.

There are quite a few options/fields for each competitor.
The previous incarnation of this AP uses a scripting
dictionary to hold the info until the credit card is
processed. Then it commits the data for all the
competitors in that family's session, to the database.

I am being asked to do it the same way, but I do not
know how this quite works. The original code is over
my head and too complex with variables for me to
figure out all that is going on.

The bottom line is that I need a way to
keep the registration data in memory, for
each registrant in that session, until the
mom or whoever then submits the credit card.
For reasons to not be explained here, I cannot
commit the data to the database beforehand.
I must keep it in memory.

If you can give me a clue or point me to where
I might learn how to handle this, I would greatly
appreciate it.

Regards,
Fox

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:e5******** ******@TK2MSFTN GP09.phx.gbl...
Dictionaries cannot contain dictionaries. You can have an array of
dictionaries though. But why are you using all these dictionaries? Do you work at an insurance company in SE Pennsylvania, by chance?

Ray at work

"Fox" <fox @ connexions.net> wrote in message
news:Ox******** ******@TK2MSFTN GP14.phx.gbl...
Hi,

I am working on a project which
used dictionaries. I am having
to remake part of this and have
no experience with the
scripting dictionary.

I need to see how to create multiple
dictionaries within one dictionary.
Can someone point me to some
reading materials on this where I
might see an example as well?

Thanks,
Fox


Jul 22 '05 #3
Fox
Note that there are 103 fields to
be remembered for each registrant.
This means that I have to keep each
of them in memory, related by their
family ID, until the credit card check
out. Then each is committed as a
separate record. I am told by the
hosts of the server, that they want
me to use the dictionary to limit the
accessing of the database to only
when necessary. Otherwise I would
commit all the data to the database and
then enable the record if the payment
was successful. But, I am not allowed
to do this.

Regards,
Fox

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:e5******** ******@TK2MSFTN GP09.phx.gbl...
Dictionaries cannot contain dictionaries. You can have an array of
dictionaries though. But why are you using all these dictionaries? Do you work at an insurance company in SE Pennsylvania, by chance?

Ray at work

"Fox" <fox @ connexions.net> wrote in message
news:Ox******** ******@TK2MSFTN GP14.phx.gbl...
Hi,

I am working on a project which
used dictionaries. I am having
to remake part of this and have
no experience with the
scripting dictionary.

I need to see how to create multiple
dictionaries within one dictionary.
Can someone point me to some
reading materials on this where I
might see an example as well?

Thanks,
Fox


Jul 22 '05 #4
"Fox" wrote in message news:eW******** ******@TK2MSFTN GP14.phx.gbl...
: Note that there are 103 fields to
: be remembered for each registrant.
: This means that I have to keep each
: of them in memory, related by their
: family ID, until the credit card check
: out. Then each is committed as a
: separate record. I am told by the
: hosts of the server, that they want
: me to use the dictionary to limit the
: accessing of the database to only
: when necessary. Otherwise I would
: commit all the data to the database and
: then enable the record if the payment
: was successful. But, I am not allowed
: to do this.
:
: Regards,
: Fox
:
: "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
: message news:e5******** ******@TK2MSFTN GP09.phx.gbl...
: > Dictionaries cannot contain dictionaries. You can have an array of
: > dictionaries though. But why are you using all these dictionaries? Do
: you
: > work at an insurance company in SE Pennsylvania, by chance?
: >
: > Ray at work
: >
: > "Fox" <fox @ connexions.net> wrote in message
: > news:Ox******** ******@TK2MSFTN GP14.phx.gbl...
: > > Hi,
: > >
: > > I am working on a project which
: > > used dictionaries. I am having
: > > to remake part of this and have
: > > no experience with the
: > > scripting dictionary.
: > >
: > > I need to see how to create multiple
: > > dictionaries within one dictionary.
: > > Can someone point me to some
: > > reading materials on this where I
: > > might see an example as well?

If you're keys for each dictionary are 1-103 with the associated answer in
the items, the dictionaries are indexed for each registrant, you can keep
track of the indexed dictionaries in a variable as a counter.

Most likely the payment portion should be in it's own dictionary.

dx = dictionary
Ex.
d0 = Payment information. ' dictionary 0
d1 = First registrant ' dictionary 1
d2 = Second registrant ' dictionary 2
ndx = 2 ' variable to hold registrant index

ndx will be 1 for only 1 person and x for x number of persons being
registered all being paid for by the same credit card.

Not see code makes it difficult but this is a simple possibility if it will
work with your code.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #5
Fox wrote:
I am working on a project which
used dictionaries. I am having
to remake part of this and have
no experience with the
scripting dictionary.
I need to see how to create multiple
dictionaries within one dictionary.


Given one dictionary name(we'll call it "dict1") and a second dictionary
name ("dict2") then to store the variables (name, age, address,...) for
each merely concatenate the dictionary name with the variable name, and
store/retrieve to/from a single Dictionary object ("BigDict") e.g.:
name1 = BigDict.Item("d ict1" & "name")
age1 = BigDict.Item("d ict1" & "age" )
....
name2 = BigDict.Item("d ict2" & "name")
age2 = BigDict.Item("d ict2" & "age" )
....

Now everything's in one dictionary, BigDict, as you requested.

But you might better use the Session object, since it is addressed in a
similar manner and is more readily accessible:
name1 = Session("dict1" & "name")
age1 = Session("dict1" & "age" )
....
name2 = Session("dict2" & "name")
age2 = Session("dict2" & "age" )
....
Jul 22 '05 #6

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

Similar topics

57
3598
by: Egor Bolonev | last post by:
why functions created with lambda forms cannot contain statements? how to get unnamed function with statements?
2
2717
by: quadric | last post by:
Hi, I would like to pass a dictionary from my Python code to my Python extension, extract various values from the dictionary (from within the extension) , modify the values for the relevant keys and return the modified dictionary to Python. Can someone point me to an example of what the C code might look like to do this?
1
1674
by: t0M | last post by:
It's nearly impossible to find anything on this because of the Dictionary class, included within the dotnet framework, that pollutes any search results pertinent to my question. I want to be able to access an array of words, just like it were a physical dictionary. It's for a stupid little project, but it involves decryption. Is there a file that Word has which contains this collection of words that I can import somehow into my dotnet...
3
1486
by: seberino | last post by:
At top of a module I have an integer like so... foo = 4 In a function in that module I know I need to do 'global foo' to get at the value 4. .... IIRC, for dictionaries you DO NOT have this issue?
15
2501
by: barbaros | last post by:
Hello everybody, I need some advice on the following problem. I want to write a program (in C or C++) which will build a huge dictionary (hash array, if you prefer). The keys are strings, the values are floating point numbers. The dictionary will soon become larger than the RAM memory (I expect more than ten gygabytes). So I need to save it (or parts of it) to the disk, while still being able to
12
21391
by: Brett Romero | last post by:
If I want to take action on the Add event of a generic Dictionary, do I need to create a custom Dictionary and add an event handler for the Add() method? The dictionary is a public field on a custom control. Thanks, Brett
0
2563
by: sweeps78 | last post by:
Hi, I have a property in one of my classes that returns a Dictionary object: public abstract partial class NonStationary : Structural { protected NonStationary(string name, Shape.Shape shape) : base(name, shape) { } private Dictionary<string, Motors.Motor> _motors = new Dictionary<string, Motors.Motor>();
7
6137
by: bonk | last post by:
Hello I am acessing a Dictionary<TKey,TValuefrom multiple threads and often in a foreach loop. While I am within one of the foreach loops the other threads must not modify the collection itself since that would cause an exception in the foreach loop "foreach can not continue because the colelction was modifed". Now what is the least expensive and threadsafe way to make sure that no other threads modifies that collection. Since one of the...
8
3107
by: akameswaran | last post by:
I wrote up a quick little set of tests, I was acutally comparing ways of doing "case" behavior just to get some performance information. Now two of my test cases had almost identical results which was not at all what I expected. Ultimately I realized I don't really know how literals are treated within the interpreter. The two implementations I was looking at were: class caseFunction(object): def __init__(self):
0
8608
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
9164
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
9029
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...
1
8898
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8870
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...
0
7734
agi2029
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3051
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
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.