Link to home
Create AccountLog in
Avatar of hidrau
hidrauFlag for Brazil

asked on

How to create a library asp of functions and procedure

Hello guys, I don't know if what I want is possible, I would like to create a file.asp where is gonna be my library.
In delphi I can do that and what I only need is to call the unit and after all the functions or procedure from my library
I can call.

If it is possible, I need an example how to call the functions and how they should be declared in the library. Thanks

Alex
SOLUTION
Avatar of LTY83
LTY83

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of hidrau

ASKER

I make a file.asp with this lines:

Class Example

Public Function ExampleFunction()
DoSomething
End Function

End Class

is it?
Avatar of LTY83
LTY83

yea, but replace the function with the ones u would use, you can also use properties and subs.

Do this make any sense to you?

Thanks,

Loren
Avatar of hidrau

ASKER

so, these are the steps:

1) I create a file.asp
2) write a function like this:

// What I only need is to add "Public" to it and classe name

Classe MyClass1
    Function Even(num)
       if (num MOD 2) = 1 Then
          Even = False
       else
          Even = True
       end If
   End Function
End class

3) Use include as you explained to me. At the bottom of my asp file.

<!--#include file ="Library.asp"-->

Is It?
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of hidrau

ASKER

Well, what is the difference between class and a asp file with functions?
ASKER CERTIFIED SOLUTION
Avatar of sybe
sybe

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.