dictionary within dictionary

Discussion in 'ASP General' started by Fox, Mar 8, 2005.

  1. Fox

    Fox Guest

    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
    Fox, Mar 8, 2005
    #1
    1. Advertising

  2. 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:...
    > 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
    >
    >
    Ray Costanzo [MVP], Mar 9, 2005
    #2
    1. Advertising

  3. Fox

    Fox Guest

    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:...
    > 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:...
    > > 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
    > >
    > >

    >
    >
    Fox, Mar 9, 2005
    #3
  4. Fox

    Fox Guest

    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:...
    > 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:...
    > > 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
    > >
    > >

    >
    >
    Fox, Mar 9, 2005
    #4
  5. Fox

    Roland Hall Guest

    "Fox" wrote in message news:...
    : 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:...
    : > 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:...
    : > > 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
    Roland Hall, Mar 9, 2005
    #5
  6. 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("dict1" & "name")
    age1 = BigDict.Item("dict1" & "age" )
    ....
    name2 = BigDict.Item("dict2" & "name")
    age2 = BigDict.Item("dict2" & "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" )
    ....
    Michael D. Kersey, Mar 13, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ilias Lazaridis
    Replies:
    6
    Views:
    434
    Ilias Lazaridis
    Feb 21, 2006
  2. james_027
    Replies:
    1
    Views:
    319
    Marc 'BlackJack' Rintsch
    Aug 22, 2007
  3. Navkirat Singh
    Replies:
    6
    Views:
    3,011
    Navkirat Singh
    Jul 29, 2010
  4. Chris Rebert
    Replies:
    0
    Views:
    517
    Chris Rebert
    Jul 29, 2010
  5. Jaewoong kim Crossbreeze
    Replies:
    1
    Views:
    124
    Jaewoong kim Crossbreeze
    Apr 17, 2009
Loading...

Share This Page