If Currcell = "" Then (newbie ?)

Discussion in 'AutoCAD' started by rewilson, Feb 27, 2004.

  1. rewilson

    rewilson Guest

    If Currcell = "" Then
    MsgBox ("Could not close session, line not found.")
    Else
    Instead of a msgbox here, I'd like to run a private sub called
    "drawingbegin()". Can someone please help me accomplish this? TIA
     
    rewilson, Feb 27, 2004
    #1
  2. rewilson

    Jeff Mishler Guest

    Use the "Call" statement....
    If Currcell = "" Then
    Call drawingbegin
    Else

    HTH,
    Jeff
     
    Jeff Mishler, Feb 27, 2004
    #2
  3. rewilson

    Ben Guest

    If Drawingbegin is in the same project, then

    If Currcell = "" Then
    drawingbegin
    else

    otherwise, same as above, but reference the project that contains
    drawingbegin

    Keep in mind that control will return immediately after the End If once
    drawingbegin is finished.
     
    Ben, Feb 27, 2004
    #3
  4. rewilson

    Ben Guest

    Just for my own FYI,, I thought Call had gone the way of Let, and wasn't
    required anymore?
     
    Ben, Feb 27, 2004
    #4
  5. Yeah, it's an old habit of many.
    I feel better using CALL, it's easier when you're doing a visual debugging
    and makes code alot easier to read.
     
    Jorge Jimenez, Feb 27, 2004
    #5
  6. Hi,

    Although I never use it myself as it requires extra typing, one advantage of
    Call is that the parameters are always required to be placed in brackets so
    your typing conventions can be more consistent.

    Given:
    Function MyMacro (Parameter1, Parameter2) as Integer
    .....
    End Function

    The three lines below are viable
    MyMacro Parameter1, Parameter2
    ReturnedInteger = MyMacro (Parameter1, Parameter2)
    CALL MyMacro (Parameter1, Parameter2)
    while the three below here aren't
    MyMacro (Parameter1, Parameter2)
    ReturnedInteger = MyMacro Parameter1, Parameter2
    CALL MyMacro Parameter1, Parameter2


    Laurie Comerford
    CADApps
    www.cadapps.com.au


     
    Laurie Comerford, Feb 27, 2004
    #6
  7. Yes, you are correct.!
    That's another reason why I like to use the CALL statement
     
    Jorge Jimenez, Feb 28, 2004
    #7
  8. rewilson

    rewilson Guest

    Thanks Jeff..............You're kinda everywhere,aren't you?
     
    rewilson, Feb 28, 2004
    #8
  9. rewilson

    rewilson Guest

    Thanks everyone.......maybe I can get there from here.
     
    rewilson, Feb 28, 2004
    #9
  10. rewilson

    Jeff Mishler Guest

    Heh, you're welcome, and yeah, I look everywhere I can learn or might
    even help someone else to learn......

    Jeff
     
    Jeff Mishler, Mar 3, 2004
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.