Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21273

Question about Class Module vs BAS Module

$
0
0
In a Class Module I have the following Sub:

Code:

Public Sub SaveStreamBuffer(StreamIdx As Integer, recBuffer() As Byte)
 ' Saves A Record Buffer To A Record Buffer Array
 ' If Buffer Is Free
 If (LenB(MidB(PlayWaveBuffer.Stream(StreamIdx).Waves(CurRecPos(StreamIdx)).Data, 1)) < 3) Then
  PlayWaveBuffer.Stream(StreamIdx).Waves(CurRecPos(StreamIdx)).Data = recBuffer ' Copy Buffer From Rec
       
  IncBufferPointer CurRecPos(StreamIdx)                '  Increment Buffer Pointer To Next Free Position...
 End If                                                  ' Else Ignore Buffer Data
End Sub

Now in a BAS Module I have a similar Sub:

Code:

Public Sub SaveOutStreamBuffer(StreamIdx As Integer, OutBuffer() As Byte)
 '
 ' Similar code but the code is not the issue
 '
End Sub

OK, now in the Form I have the following call statements:

Code:

  '
  '
 Static ExData(MAXTCP) As Byte 'Variant                    ' Extra bytes from frame buffer
 
 ExData(Index) = MidB(ExData(Index), 1) & MidB(WaveData, 1) ' Sync wave bits...
         
 wStream.SaveStreamBuffer Index, ExData(Index)    ' Save the current wave data to the wave buffer
 SaveOutStreamBuffer Index, ExData(Index)            ' Save the current wave data to the wave buffer
   
 wStream.AddStreamToQueue Index                        ' Queue the current wave stream
               
 ExBytes(Index) = 0                                            ' Clear Extra byte count
  '
  '

OK, now when I compile the project the compiler makes no complaints about the first call to the Class sub but it does about the call to the BAS module sub:

Type Mismatch: array or used-defined type expected

Question:

Why the compiler error on SaveOutStreamBuffer Index, ExData(Index)

Viewing all articles
Browse latest Browse all 21273

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>