Results 1 to 2 of 2

Thread: IP address addition

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    16

    Question IP address addition

    How do I perform IP address additon if the input is in 1 single textbox?

    Suppose if starting IP is 253.254.255.0 and the last one is to be 255.255.255.255 how do i break each octet and perform the addition to reach the last ip.

  2. #2
    Addicted Member Cimperiali's Avatar
    Join Date
    Oct 2002
    Location
    Milan, Italy, Europe
    Posts
    188

    How to: extract the octects

    Code:
    Option Explicit
    
    Private Sub Command1_Click()
    Dim theOct() As String
    theOct = Split(Text1.Text, ".")
    If UBound(theOct) <> 3 Then
       MsgBox "Fill correct: xxx.xxx.xxx.xxx"
       Exit Sub
    End If
    'now do your calculation on each cell of array
    'theOct(0)
    'theOct(1)
    'theOct(2)
    'theOct(3)
    End Sub

    Cesare I.
    Special thanks to some wonderful people,
    such as Lothar the Great Haensler, Aaron Young,
    dr_Michael, Chris Eastwood, TheOnlyOne ClearCode....

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