VBScript function library.

Results 1 to 8 of 8

Thread: VBScript function library.

  1. #1
    J-F Guest

    Default VBScript function library.

    I&#039m creating WEB forms thant are using VBScript.<BR><BR>I&#039m sure there&#039s a way to create a library containing functions that I could call from any form.<BR><BR>How can it be set up?<BR>(Is there an "include" that can be done?)

  2. #2
    Patty Guest

    Default Maybe this helps...


  3. #3
    J-F Guest

    Default RE: Maybe this helps...

    Thanks fo the link!<BR>I added it in my Favorites.<BR><BR>But I would like to create my own library of functions that I could access from any form. (Like a module!) <BR>Example: I have a function that validates a date format and I need it in 15 forms. But I don&#039t want to paste the code 15 times!

  4. #4
    John Reynolds Guest

    Default RE: Maybe this helps...

    The best thing I can think of is to paste that code into another ASP file and then use includes to include that file&#039s code in the current page. <BR><BR>For example:<BR>&#060;!-- #include file="library_of_functions.asp" --&#062;<BR><BR>And then you can call all of your Subroutines and functions from that file in the current page. Let me know if you have any more questions.

  5. #5
    J-F Guest

    Default RE: Maybe this helps...

    Thank you!<BR><BR>Where can I put the include statement?

  6. #6
    Patty Guest

    Default Are you talking about DLL 's ???

    If you want it easy and simply "call" a function using objects, then you need to create a dll and register that dll on your system. In your dll, you will have defined the function that you would like to call 15, 20...times.<BR><BR>Do create DLL&#039s you can use VB, create your function in there, and then convert it to dll. But if you don&#039t have access to the server physically, you will not be able to register the dll and your function will not work.<BR><BR>In that case, the best thing that you do is create a seperate file, with .inc extension, define your function in there, then in you main asp page, you simply include the .inc file and call your function whenever you want. That&#039s the simpliest way.

  7. #7
    J-F Guest

    Default RE: Are you talking about DLL 's ???

    Looks like you both answered my question!<BR><BR>Thank you!

  8. #8
    Richard A. Lowe Guest

    Default RE: Maybe this helps...

    Best to put it at the top of your pages, beneath any page directives (@language=VBScript etc). <BR><BR>Richard

Posting Permissions

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