VB: Argument listings

Results 1 to 2 of 2

Thread: VB: Argument listings

  1. #1
    Jason Marou Guest

    Default VB: Argument listings

    When working with Visual Basic (or any other development tool), it is possible to see which arguments can be entered for a function, procedure or property. Some of the standard VB or ASP-functions have arguments that are basically lists (such as the &#039locktype&#039 property for recordsets - you get a nice list with possible locktypes). How can i add this functionality<BR> to my own functions, procedures and methods?

  2. #2
    Christiaan Verwijs Guest

    Default RE: VB: Argument listings

    What you want is quite easy. Just use enumbered lists like this:<BR><BR>PUBLIC ENUM DeleteMethods<BR> deDeleteAll = 1<BR> deDeleteSingle = 2<BR> deDeleteBefore = 3<BR> deDeleteAfter = 4<BR>END ENUM<BR><BR>Add this piece of code somewhere in the top of your class (or module). Now, when you want to use this in a function or procedure argument, do it like this:<BR><BR>PUBLIC SUB DeleteRecords(strMethod As DeleteMethods)<BR>....<BR><BR>If you try to call the procedure from within InterDev or VB, you will get the list of possible choices (which are basically the options entered in the enumbered list). That&#039s all!<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts