Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Invalid Procedure Call or Arguement VB

  • 09-04-2008 12:12am
    #1
    Registered Users, Registered Users 2 Posts: 315 ✭✭


    Private Sub drawgraph()
    Dim lLowByte As Long ' Holds LowByte value
    Dim currentx, currenty, x, y As Integer
    drawgrid
    currentx = 0
    'currenty = 0
    'CurrentBit() = 0

    For i = 1 To 385

    lLowByte = Asc(Mid$(sData, i, 1)) <
    error here
    ConvertBin (lLowByte)
    For j = 0 To 7
    'If Bit(j) = 1 Then picOutput.ForeColor = &HFF& Else picOutput.ForeColor = &HFF0000
    picOutput.Line (currentx, CurrentBit(j) * 22 + j * 32 + 3)-(i, Bit(j) * 22 + j * 32 + 3)
    CurrentBit(j) = Bit(j)
    Next j
    currentx = i
    'currenty = lLowByte

    DoEvents
    Next
    MSComm1.PortOpen = True

    End Sub


    Getting an error saying Invalid Procedure Call or Arguement and i have no idea why, anybody got any ideas? Its VB btw.


Comments

  • Registered Users, Registered Users 2 Posts: 2,777 ✭✭✭shanew


    you dont say what the contents of sData are - but this line
    will fail if the length is less than 385...

    Shane


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    sData isn't populated it would seem.
    For i = 1 To len(sData)
    
       lLowByte = Asc(Mid$(sData, i, 1)) 
    
       ...
    

    should see you right.


  • Registered Users, Registered Users 2 Posts: 315 ✭✭Full.Duck


    sData is data comming in from the com port using a usb connection. Its defined somewhere else. Thanks for the replies though.


  • Registered Users, Registered Users 2 Posts: 315 ✭✭Full.Duck


    Figured it out. There was a problem with my circuit inputting data so therefor there was no sData. Problem fixed. Thanks again for the replies.


Advertisement