PROCEDURES AND MODULES

Cards (16)

  • Event-handling procedures (or event handlers)

    Sub procedures that execute in response to an event raised by user action or by an occurrence in a program
  • Function procedures
    Return a value to the calling code. They can perform other actions before returning the value.
  • Sub procedures
    Perform actions but do not return a value to the calling code
  • ByVal
    (Default) Accepts a copy of the data from the local variables. No changes are made to the contents of the local variables when the calling procedure resumes the control of execution.
  • ByRef
    Accepts a reference of the data in the memory. The called procedure is granted read/write access to the local variable of the calling procedure.
  • Parameter
    A value that the procedure expects you to pass when you call it. The procedure's declaration defines its parameters.
  • Argument
    Represents the value that you pass to a procedure parameter when you call the procedure.
  • Returning Control from Procedures
    Procedure only returns control to the calling code when it has finished running using Return, Exit, or End statements
  • Modules

    A special file that has a .vb name extension and contains variable declarations and procedures that can be used ANYWHERE in the program
  • Knowledge of event handlers, sub procedures and modules gives Visual BASIC programmers an effective tool to use to create more efficient and systematized codes
  • Learn how to use them by familiarizing the functions which were detailed in this lecture and putting them into practice
  • Someone who is knowledgeable about something not only knows the what, but most importantly, the when, the how, and the why
  • Procedures
    It is a self contained block and a set of executable statements.
  • Event Handlers

    event within a program
  • Sender
    Parameters of event handlers where the object is causing an event
  • e
    Parameters of event handlers where there is a specific action