DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2004

    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
    I found my problem.

    I guess I just needed some one to listen.

    Thanks for being there.

  3. #3
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    Post what you did.

    It may help someone else with a 'funny variable'.

  4. #4
    Join Date
    Nov 2004
    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
    Sterling Heights, Michigan
    Thank you for posting back!

Similar Threads

  1. GetString Help
    By Chris Yard in forum VB Classic
    Replies: 5
    Last Post: 02-08-2007, 05:44 AM
  2. Variable scope from XMLHttpRequest Callback
    By spydersweb in forum AJAX
    Replies: 1
    Last Post: 08-29-2006, 02:07 PM
  3. How to retain session variable
    By NikhilSriv in forum Java
    Replies: 1
    Last Post: 06-14-2006, 05:24 AM
  4. sql variable problem
    By Lymarie in forum Database
    Replies: 0
    Last Post: 04-02-2001, 10:16 AM
  5. Re: Passing an object name through a variable
    By mrfelis in forum VB Classic
    Replies: 9
    Last Post: 04-25-2000, 10: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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

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

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.