1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Passing string from one private sub to another private sub

Discussion in 'Visual Basic ( VB )' started by terrylau, Jul 10, 2009.

  1. terrylau

    terrylau New Member

    Joined:
    Jul 2, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Hi, need suggestion or help to pass string from one private sub to another private sub. For example :

    Private Sub 1
    stringB = stringA

    Private Sub 2
    stringA

    How do I pass the stringA to stringB?
    Have been reading around but not so sure about some of the comments on using ByVal, byRef or even using Public Sub and Module.

    Appreciate any input into this. Thanks in advance.
     
  2. naimish

    naimish New Member

    Joined:
    Jun 29, 2009
    Messages:
    1,046
    Likes Received:
    18
    Trophy Points:
    0
    Occupation:
    Software Engineer
    Location:
    On Earth
    Delcare that string Globally.
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    Subroutines in VB does not take params
     
    Last edited: Jul 10, 2009
  4. naimish

    naimish New Member

    Joined:
    Jun 29, 2009
    Messages:
    1,046
    Likes Received:
    18
    Trophy Points:
    0
    Occupation:
    Software Engineer
    Location:
    On Earth
    I think he is asking in Visual Basic ( VB ) Shabbir !!
     
  5. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    Sorry that was a typo. PHP does not have subroutines
     
  6. naimish

    naimish New Member

    Joined:
    Jun 29, 2009
    Messages:
    1,046
    Likes Received:
    18
    Trophy Points:
    0
    Occupation:
    Software Engineer
    Location:
    On Earth
  7. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    Trademarked :D
     
  8. naimish

    naimish New Member

    Joined:
    Jun 29, 2009
    Messages:
    1,046
    Likes Received:
    18
    Trophy Points:
    0
    Occupation:
    Software Engineer
    Location:
    On Earth
  9. terrylau

    terrylau New Member

    Joined:
    Jul 2, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Yes.. I'm asking in VB6 :shy: Will making it as public sub helps?
     
  10. naimish

    naimish New Member

    Joined:
    Jun 29, 2009
    Messages:
    1,046
    Likes Received:
    18
    Trophy Points:
    0
    Occupation:
    Software Engineer
    Location:
    On Earth
    Delcare that string Globally, it will work.
     

Share This Page