Results 1 to 3 of 3

Thread: Wrong number of arguments when using line method

  1. #1

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    I don't know what is causing your problem, but if commenting the lines, re-running, etc works then try the following:
    1) Go to Project>YourProject>Make
    2) Add "LineProblem = 0" without the quotes in the Conditional Compilation Arguments textbox
    3) Bracket all your Form1.Line... lines with conditional If/Else as follows
    #If Not LineProblem Then
    Form1.Line (1, 1)-(1000, 1000)
    Form1.Line (1, 2)-(500, 123)
    #End If

    Then when you want to "rem" the lines, just change the Make parameter to LineProblem = -1 (or any non-zero value), and the problem lines lines will not be included when the program runs.

    ------------------
    Marty
    What did the fish say when it hit the concrete wall?
    > > > > > "Dam!"

  2. #2
    New Member
    Join Date
    Jan 2000
    Posts
    13

    Post

    I have noticed I often get the error message


    "Compile error

    Wrong number of arguments or invalid property assignment"

    This error will be reported to have come from a line using the line method e.g.

    Form1.Line (1, 1)-(1000, 1000)


    The error would appear to occur as a result of an error somewhere else in the program and the only way to get rid of it is to rem out all such lines from the program, re-run the program and then reinstate the remed out lines. This is a real pain.

    I have seen the same problem in several different programs and on several different machines.

    I am using VB5

    Does anyone know why this error occurs and how to avoid it ?

  3. #3
    New Member
    Join Date
    Jan 2000
    Posts
    13

    Post

    Thanks for your help. I tried what you suggested, it worked fine and I think I see why it works. However in the process of trying this I noticed something rather odd. You don’t actually have to include the conditional IF/Else around the code which draws the line, just changing the contense of the "conditional compile arguments textbox" is sufficient to make the program run again even without the IF/Else condition.

    If you want to try this run the following code

    Dim AR(3)
    AR(4) = 6
    Form1.Line (1, 1)-(1000, 1000)

    The program will run but stop at the second line correctly indicating that the subscript is out of range. Change the 2ed line to AR(3) = 6 and continue to run the program. Note you now get the error I originally talked about on the 3rd line. No amount of re-starting the program will get rid of the error, however, if you change the contense of the "conditional compile arguments textbox" the program will run again without errors.

    Can anyone explain what is going on here ?


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