I may be missing something, but it sounds like you can solve this
issue not with a set of classes, but with one class and a set of
instances of that class. You want a Stack class where you can create
an instance with a set number of stack positions.
VBScript does not allow parameters on the initialization method,
but you can make your own secondary setup function and make it
return the object being created, then use a pretty intuitive syntax
to do this anyway:
class Blah
private sub Class_Initialize
:
:
public function init(p1)
' ... set things up using p1 as needed ...
' This next line makes the below syntax work.
set init = me
dim o : set o = new Blah.init(5)
On Mon, Apr 30, 2012 at 10:20:35AM -0700, David Helkenn wrote:
Hello,
Does VB Script support a way to parameterize a class? In some
languages, it is possible to define a 'virtual' or 'generic' class,
such that when it is instantiated, the developer supplies the required
parameters. For example, a virtual stack may be one number deep in one
instance and another depth in a second instance. Or, the contents of
the stack may be trucks in one, cows in a second, or temperatures in a
third. In other words, it might be possible to define stacks of
differing depths, differing objects, or both. For example, supply the
required parameters and one could get a stack of up to 8 cows, etc.
I'm not finding any way to have half a dozen 'stacks' for my data
objects -- one stack of four, another of 13, and the rest with 22.
Thanks for any help with this one!
Dave
--
Doug Lee, Senior Accessibility Programmer
SSB BART Group - Accessibility-on-Demand
mailto:[email protected] http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller