Results 1 to 3 of 3

Thread: Easy Question regarding the

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    Good morning everyone ,

    Have a look below .

    [Code]
    CurrentSends = CurrentSends + 1
    ReDim Preserve arrSendme(CurrentSends)
    Set arrSendme(CurrentSends) = New Sendme
    With arrSendme(CurrentSends)
    arrSendme(0).Filename = Filenamestr$
    arrSendme(0).Ip
    arrSendme(0).Port
    arrSendme(0).Size
    arrSendme(0).Ext
    arrSendme(0).From = SendersNick$
    Case Is = 2
    'User Declined File
    Dim returnto As String
    Dim retvalFile As String

    The Bold line above causes an error . The code below is in a module
    Code:
    Public arrSendme() As Sendme
    
    Public Type Sendme
        Ip As String
        Port As Long
        Filename As String
        Size As Long
        Ext As String
        From As String
        
    End Type
    Do you have an idea on whats going wrong ?

    Thanks again guys ,

    []P
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

  2. #2
    Addicted Member
    Join Date
    Oct 2000
    Location
    Vienna/Austria
    Posts
    132
    Hi PRIVATE1 !!!

    You can't "set" an array. Set is only for Object.

    the code should look like

    Code:
    'make sure if this in "sub" or function and arrSendme
    'is public that currentsends is declared as static
    ' = remember symbol after calling function or sub
    CurrentSends = CurrentSends + 1
            'redim the array and keep the old endtries
            ReDim Preserve arrSendme(CurrentSends)
            'comment this line out not needed
            'Set arrSendme(CurrentSends) = New Sendme 
    
            'set the values of arrsendme
            With arrSendme(CurrentSends)
               .Filename = Filenamestr$
               .Ip
               .Port
               .Size
               .Ext
               .From = SendersNick$
            end with
    
           ... and so on in your code

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    Thanks . Now I know it's only for objects .


    []P
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

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