I have a funny variable


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: I have a funny variable

  1. #1
    Join Date
    Nov 2004
    Posts
    293

    I have a funny variable

    In a module titled "Variables" I have declared a public variable TextAddr as a variant, on main form load I set this variable to 888 in other subs on the main form I use this variable and the value is there, later in my program I use a function located on a module titled "MotorControl" and in that function I also use my variable TextAddr, but at that time it's empty and I can not see why. If I move that entire funtion code to the main form then all is ok and the variable has the value but as soon as I move the code of the funtion off the main form the variable is empty.

  2. #2
    Join Date
    Nov 2004
    Posts
    293
    I found my problem.

    I guess I just needed some one to listen.


    Thanks for being there.

  3. #3
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Post what you did.

    It may help someone else with a 'funny variable'.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  4. #4
    Join Date
    Nov 2004
    Posts
    293
    The root of my problem is that I agreed to make some changes to someone elses program and that someone else is a much higher level programer then I. He had a text box named TextAddr (that I was not aware of) and in his program and he was using a statement like "TextAddr = 123" in his program code, so I looked at that statement and thought that it was a variable that was being set to the value of 123.

    I dident know that when you put a value in a text box you dont have to say "frmMain.TextAddr.Text = 123" but you can simply say "TextAddr = 123" provided you do it in code that's located on the same form as the text box.

    So I learned something.

  5. #5
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Thank you for posting back!
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. GetString Help
    By Chris Yard in forum VB Classic
    Replies: 5
    Last Post: 02-08-2007, 06:44 AM
  2. Variable scope from XMLHttpRequest Callback
    By spydersweb in forum AJAX
    Replies: 1
    Last Post: 08-29-2006, 03:07 PM
  3. How to retain session variable
    By NikhilSriv in forum Java
    Replies: 1
    Last Post: 06-14-2006, 06:24 AM
  4. sql variable problem
    By Lymarie in forum Database
    Replies: 0
    Last Post: 04-02-2001, 11:16 AM
  5. Re: Passing an object name through a variable
    By mrfelis in forum VB Classic
    Replies: 9
    Last Post: 04-25-2000, 11:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center