Static variables with variable names

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jerry Spence1

    #1

    Static variables with variable names

    Sorry for the confusing title - not quite sure what I'm after here.

    I think need to have a static variable in a procedure, but the name of that
    variable will be designated at run time. Also I don't know how many
    variables I need until run time either!

    Just to explain, I have a number of IP based door access control readers and
    I need to retain a status flag about certain ones - I don't know which ones
    until run time. The readers have names. So I might have:

    static <my variable> as boolean

    which will come out as static Reader_30 as boolean

    There may be another way of doing this of course, such as properties.

    -Jerry



  • m.posseth

    #2
    Re: Static variables with variable names

    well in this situation i would create a structure that holds the required
    info about the status ( boolean , string , integer values about the status
    etc etc )
    then store these structures in a hashtable or collection ( i prefer the
    hashtable as it is the fastest )

    now you can save these values with anny name you like , and can even check
    for there existence in the lookup table

    i could write you an example if you like the idea

    regards

    Michel Posseth




    "Jerry Spence1" <jerry.spence@s omewhere.com> wrote in message
    news:436e046f$0 $63051$ed2e19e4 @ptn-nntp-reader04.plus.n et...[color=blue]
    > Sorry for the confusing title - not quite sure what I'm after here.
    >
    > I think need to have a static variable in a procedure, but the name of
    > that variable will be designated at run time. Also I don't know how many
    > variables I need until run time either!
    >
    > Just to explain, I have a number of IP based door access control readers
    > and I need to retain a status flag about certain ones - I don't know which
    > ones until run time. The readers have names. So I might have:
    >
    > static <my variable> as boolean
    >
    > which will come out as static Reader_30 as boolean
    >
    > There may be another way of doing this of course, such as properties.
    >
    > -Jerry
    >
    >
    >[/color]


    Comment

    • Jerry Spence1

      #3
      Re: Static variables with variable names

      I think I like that idea - but am not very knowledgable on it. If you have
      an example I'd be grateful

      -Jerry


      "m.posseth" <michelp@nohaus ystems.nl> wrote in message
      news:eYIxfit4FH A.2888@tk2msftn gp13.phx.gbl...[color=blue]
      > well in this situation i would create a structure that holds the required
      > info about the status ( boolean , string , integer values about the status
      > etc etc )
      > then store these structures in a hashtable or collection ( i prefer the
      > hashtable as it is the fastest )
      >
      > now you can save these values with anny name you like , and can even check
      > for there existence in the lookup table
      >
      > i could write you an example if you like the idea
      >
      > regards
      >
      > Michel Posseth
      >
      >
      >
      >
      > "Jerry Spence1" <jerry.spence@s omewhere.com> wrote in message
      > news:436e046f$0 $63051$ed2e19e4 @ptn-nntp-reader04.plus.n et...[color=green]
      >> Sorry for the confusing title - not quite sure what I'm after here.
      >>
      >> I think need to have a static variable in a procedure, but the name of
      >> that variable will be designated at run time. Also I don't know how many
      >> variables I need until run time either!
      >>
      >> Just to explain, I have a number of IP based door access control readers
      >> and I need to retain a status flag about certain ones - I don't know
      >> which ones until run time. The readers have names. So I might have:
      >>
      >> static <my variable> as boolean
      >>
      >> which will come out as static Reader_30 as boolean
      >>
      >> There may be another way of doing this of course, such as properties.
      >>
      >> -Jerry
      >>
      >>
      >>[/color]
      >
      >[/color]


      Comment

      Working...