Print Page | Close Window

VBScript Classes - Using Functions

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=4529
Printed Date: 30 March 2026 at 10:07am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: VBScript Classes - Using Functions
Posted By: pnp!
Subject: VBScript Classes - Using Functions
Date Posted: 25 July 2003 at 1:11pm

I know that you can use subs inside a VBscript class.
But I've tried with some funcion and I get an error...

Do someone know if it's posible to have a Function inside a Class?
(ie: the code below)

Class Test
 Dim number

 Function convert(num)
  convert = num + 1 
 End Function

End Clas


If it can't be done... How can I do it? what would be the correct way?

Thanks in advance!




Replies:
Posted By: Flamewave
Date Posted: 25 July 2003 at 9:40pm

class test
  some code

  public sub subname
    some code
  end sub

  public function convert(num)
    some code
  end function

end class



-------------
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net