Results 1 to 7 of 7

Thread: Splitting and Sending [RESOLVED]

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2006
    Posts
    35

    Splitting and Sending [RESOLVED]

    I want to split a number , lets say 1435 by every single number so I get an array that returns Number(0) = 1, Number(1) = 4, Number(2) = 3, Number(3) = 5. How do I do that?
    Also I need it so that a String, strPath, has the same data as all forms of the project. How do i dot that?
    Last edited by Prodian; Sep 28th, 2006 at 07:56 AM.

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Splitting and Sending

    Define strPath as a global variable in a module.

    VB Code:
    1. Dim MyNumber() As Integer
    2. Dim SplitNumber As Long
    3. Dim i As Integer
    4.  
    5. SplitNumber = "1435"
    6. ReDim MyNumber(Len(SplitNumber))
    7.  
    8. For i = 1 To Len(SplitNumber)
    9.  
    10. MyNumber(i) = Mid$(SplitNumber, i, 1)
    11.  
    12. Next

  3. #3
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Splitting and Sending

    Quote Originally Posted by Prodian
    Also I need it so that a String, strPath, has the same data as all forms of the project. How do i dot that?
    Ahh... What ?

  4. #4
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: Splitting and Sending

    VB Code:
    1. Dim i As Long
    2. Dim a As String
    3. Dim b() As Byte
    4.  
    5.     a = "12345"
    6.  
    7.     b = a
    8.  
    9.     Debug.Print a, UBound(b)
    10.     For i = 0 To UBound(b) Step 2
    11.         Debug.Print Chr(b(i)), Chr(b(i + 1))
    12.     Next i
    Now every even element will contain the ascii value of the character from the string.

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2006
    Posts
    35

    Re: Splitting and Sending

    Quote Originally Posted by CVMichael
    Ahh... What ?
    I have this string that holds the path of a file on one form. I want another form to have the same string with the same value, and if it is cahnged on one form it will be changed on the other.
    Last edited by Prodian; Sep 28th, 2006 at 07:42 AM.

  6. #6
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: Splitting and Sending

    Make a global (Public) variable or give the form a property that returns this string and let all other forms refer to this property.

  7. #7

    Thread Starter
    Member
    Join Date
    Apr 2006
    Posts
    35

    Re: Splitting and Sending

    Thanks for the quick responses.

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