Separating class statements from ASP file 
Author Message
 Separating class statements from ASP file

Hi,

I have a question regarding whether class statements can be separated
from an ASP file (as they can be in Java)?

For example, say I had an ASP file ("login.asp") which had the following
embedded class statement:

   class Person
      public sub doSomething()
         ...
      end sub
   end class

Would I be able to separate the class statement from the ASP file and put
it into another file? If so, what would I call the class statement file
(such as "Person.asp", "Person.vbs" or "Person.cls")?

Also, how would I declare objects of this class in my ASP file? I'm
assuming the following will have problems?:

   dim p
   set p = new Person

From what I've been reading so far, it seems that the above won't work
unless the classes are configured with the server, or I may be completely
wrong.

Any help will be greatly appreciated,

Sarch
--
Spamblock in action: Remove NOTREAL from address to reply via email.

  "Look, if that's where those poor children are, of course I'll go
   to Somalia."  -  Amanda Keller, "The Hub"



Sun, 09 Mar 2003 14:22:28 GMT  
 Separating class statements from ASP file

Just put them in an include file and #include them in the page - the file name/extension doesn't
really matter...

<%
   class Person
      public sub doSomething()
         ...
      end sub
   end class

%>

--
Michael Harris
Microsoft.MVP.Scripting
--

Quote:

> Hi,

> I have a question regarding whether class statements can be separated
> from an ASP file (as they can be in Java)?

> For example, say I had an ASP file ("login.asp") which had the following
> embedded class statement:

>    class Person
>       public sub doSomething()
>          ...
>       end sub
>    end class

> Would I be able to separate the class statement from the ASP file and put
> it into another file? If so, what would I call the class statement file
> (such as "Person.asp", "Person.vbs" or "Person.cls")?

> Also, how would I declare objects of this class in my ASP file? I'm
> assuming the following will have problems?:

>    dim p
>    set p = new Person

> From what I've been reading so far, it seems that the above won't work
> unless the classes are configured with the server, or I may be completely
> wrong.

> Any help will be greatly appreciated,

> Sarch
> --
> Spamblock in action: Remove NOTREAL from address to reply via email.

>   "Look, if that's where those poor children are, of course I'll go
>    to Somalia."  -  Amanda Keller, "The Hub"



Sun, 09 Mar 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ASP Class Statements

2. SQL statement separating semicolon delimited values

3. Have a class compile into a separate dll?

4. Unexpected Error +ASP Class files

5. How to separate .eml file within .eml file

6. Creating multi-page TIff file from separate Tif files

7. separating pages into separate documents

8. using class statement problem

9. Unexpected Error +ASP Class files

10. Class Statement

11. Reading a comma separated variable file? (.csv file)

12. how to use Class statement

 

 
Powered by phpBB® Forum Software