[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

scope of declaration

Posted on 2004-04-18
3
Medium Priority
?
245 Views
Last Modified: 2010-04-24
I have declared a hashtable to use with the form like this:

********************
Public Class Form1
    Inherits System.Windows.Forms.Form

   dim htCarrierIndex As New Hashtable()
********************

Okay, so during form_load I populate the hashtable, and it works fine.
Like: MsgBox(htCarrierIndex(0)) returns the value at the 0 key.  Great.

But after form_load, it doesn't work anymore.
MsgBox(Form1.htCarrierIndex(0)) gives me no value.  I've tried dim, public, shared.  What gives?

Thanks in advance.


0
Comment
Question by:scator
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:scator
ID: 10854031
maybe it's NOT fine--

******************************
For j = 0 To datatable.Rows.Count - 1
            result = datatable.Rows(j)
            'adding cboindex, carrierindex as key/value pair
            htCarrierIndex.Add(j, "hello")
            'htCarrierIndex.Add(j, result(0))
            cboCarrier.Items.Add(result(1))
            MsgBox(htCarrierIndex(0))

           
        Next
        MsgBox(htCarrierIndex(0))
**************************

during the loop, the msgbox displays the value.  outside the loop (the second msgbox) no value is displayed.  very confusing
0
 

Author Comment

by:scator
ID: 10854053
Okay folks.  I am changing this question to:

HOW DO I DELETE THIS QUESTION (WHICH IS WRONG) THAT I POSTED TWO MNUTES AGO?

Thanks
0
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 375 total points
ID: 10854248
post a 0 point request to Community Support to have the question deleted.

AW
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question