help me with my program.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bagstoper
    New Member
    • Feb 2007
    • 40

    help me with my program.

    i am attempting to make a video game. I need to know how to declare a global variable. could someone post code that will let me make a global variable.

    thanks...
  • sukeshchand
    New Member
    • Jan 2007
    • 88

    #2
    To declare a global variable you must add a module(Goto Project Menu->Add Module) to your project first and declare variable in it like this
    Code:
    Public gIntLevel As Integer
    Public gstrPlayerName As String
    Last edited by Killer42; Feb 13 '07, 02:43 AM. Reason: Correct a typo

    Comment

    • bagstoper
      New Member
      • Feb 2007
      • 40

      #3
      which is the variable? cause i need to make about 15 of them. how do i call them out in my program.

      Comment

      • bagstoper
        New Member
        • Feb 2007
        • 40

        #4
        i just need to find out how to call them out in my program

        Comment

        • balid
          New Member
          • Feb 2007
          • 18

          #5
          Originally posted by bagstoper
          i just need to find out how to call them out in my program
          Just use the variable name in the line of code.
          IE:
          Code:
          public variable1 as string
          public variable2 as string
          
          ... your code ...
          variable1 = "hello"
          variable2 = variable1 + "there"
          
          ...
          
          if variable1 = "hello" then
          end if
          Something like that.

          Comment

          • bagstoper
            New Member
            • Feb 2007
            • 40

            #6
            ok thank you

            Comment

            Working...