Use of Public Subs

Results 1 to 3 of 3

Thread: Use of Public Subs

  1. #1
    Join Date
    Dec 1969

    Default Use of Public Subs

    How do I incorporate the Private, Public Subs into my asp like when using regular VB? I mean, I need really basics on how to use them. Please direct me to a tutorial site, etc.

  2. #2
    Join Date
    Dec 1969

    Default RE: Use of Public Subs

    I assume you are asking, "How do I create an ActiveX dll that I can use in my web site?" The answer is as simple as create a VB project of type ActiveX dll. Compile it, register it on your web server, and call it from you ASP script with Server.CreateObject.<BR><BR>Of course, nothing is this simple. For further reference, I would suggest "Developing ActiveX Components With Visual Basic" by Dan Appleman or "Programming With Class" by Deborah Kurata.

  3. #3
    Join Date
    Dec 1969

    Default If not the above....

    ...then you&#039;re mistaken about how ASP works. It is a scripting language, rather than an event driven language.<BR><BR>That means that the page will execute from top to bottom, jumping to any subroutines or functions if they are called. However, it cannot respond to events, and it cannot be called from another page.<BR><BR>Not in the same way you can call a subroutine in a VB form from another form, anyway. You can include the ASP code in another ASP page, but when it is compiled, it is treated as one page.<BR><BR>As a result, the subroutines can not be private or public, as they can only be accessed as part of that script. They are all, effectively, private.<BR><BR>There is one exception, and that&#039;s if you are creating a VBScript class. In which case, private subroutines have scope only inside the class, and public subroutines can be called as methods of the class. However, this is probably not what you are doing....<BR><BR>Craig.

Posting Permissions

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