Results 1 to 5 of 5

Thread: global integer?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    5

    global integer?

    hello poeple. i'm facin a problem with an integer in two different makro's. here is the case: i define an integer in one makro, the call another and try to use the integer in it. something like this:

    sub makro1()
    dim kkk as integer
    kkk = 5
    call makro2
    end sub

    sub makto2()
    selection.typetext text:="something" & kkk
    end sub

    it doesn't work of course. is there any way to, i don't know, make the kkk a global integer ?

  2. #2
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: global integer?

    Code:
    dim kkk as integer
    
    sub makro1()
       kkk = 5
       call makro2
    end sub
    
    sub makto2()
       selection.typetext text:="something" & kkk
    end sub
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • If your question was answered please use Thread Tools to mark your thread [RESOLVED]
    • Don't forget to RATE helpful posts

    • Baby Steps a guided tour
    • IsDigits() and IsNumber() functions • Wichmann-Hill Random() function • >> and << functions for VB • CopyFileByChunk

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: global integer?

    Wouldn't you want to do: Public kkk As Integer?

  4. #4
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: global integer?

    Quote Originally Posted by Hack
    Wouldn't you want to do: Public kkk As Integer?
    Unless it will be used in more than one modules.
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • If your question was answered please use Thread Tools to mark your thread [RESOLVED]
    • Don't forget to RATE helpful posts

    • Baby Steps a guided tour
    • IsDigits() and IsNumber() functions • Wichmann-Hill Random() function • >> and << functions for VB • CopyFileByChunk

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: global integer?

    Quote Originally Posted by anhn
    Unless it will be used in more than one modules.
    Good point. For me, using Public is probably more habit than necessity.

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