CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2001
    Location
    Indiana
    Posts
    6

    Variable Help ???

    I am trying to write a code statement that will create a variable called total to be used in multiple subroutines with a data type of short. thanks


  2. #2
    Join Date
    Jun 2001
    Location
    Sri Lanka
    Posts
    272

    Re: Variable Help ???

    The variable type should be either byte or integer
    Byte : An integer value between 0 and 255
    Integer : A value in the range -32,768 to 32,767

    The scope of the variable depends on the task that u want to perform with those variables.
    * If all subroutines u want to use the variable are in a single form(or in a single module)
    - u can define within the subroutines and pass as parameters
    - u can define in the general declaration area of the form (or in the module) in the following format Dim iTotal as Integer


    * If all subroutines u want to use the variable are in different forms (or in different modules/forms)
    - u can define within the subroutines and pass as parameters
    - u can define in the form (or in the module) in the following format public iTotal as Integer

    Whenever used, use it with the form name in the first part (in the case of defined in the form)
    Eg. Form1.iTotal = 17


    IS THIS ENOUGH?
    Srinika

    If u don't know how to Rate an answer, then Rate my answer to learn, If u know, then practice it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured