Just when I thought my problems were all over ... or at least the sorting ones ... I found that my machine didn't have enough virtual memory to handle the sort using ADODB (and I don't have the privilege level to do anything about it).
So I ported a heap sort to VBScript and ... so far ... everything look like it's going to work.
Here's the code
... and to use it, something like this ...
Past (20 years or so) and present code. A variety of languages and platforms. Some gems. More gravel. Some useful stuff and some examples of how not to do it.
Showing posts with label class. Show all posts
Showing posts with label class. Show all posts
Tuesday, October 11, 2005
Tuesday, September 27, 2005
[VBScript] "Watcher" - on the way to code profiling ... sort of
I've just implemented a new class, Watcher, which is giving me an idea of what routines in my stdFunctions.vbs are actually being used, and how frequently.
At present the class depends on some of the routines it would otherwise be watching so those routines can't refer to Watcher until such time as I make the class self-contained.
The class gets instantiated in the usual way right at the start of my stdFunctions.vbs file and then at the beginning of each of the subs and functions in stdFunctions.vbs there is a reference to watch, e.g. When the class terminates the data is saved in Watcher.txt as lines of tab-delimited text, for example: and these are then read back in at the initialisation of class next runtime round.
If you find this useful please let me know. Code below.
At present the class depends on some of the routines it would otherwise be watching so those routines can't refer to Watcher until such time as I make the class self-contained.
The class gets instantiated in the usual way right at the start of my stdFunctions.vbs file and then at the beginning of each of the subs and functions in stdFunctions.vbs there is a reference to watch, e.g. When the class terminates the data is saved in Watcher.txt as lines of tab-delimited text, for example: and these are then read back in at the initialisation of class next runtime round.
If you find this useful please let me know. Code below.
Labels:
class,
profiling,
StandardLibrary,
VBScript,
Watcher
Monday, September 19, 2005
[VBScript] Timer class
A class to set multiple timers and get back program run time in seconds, or as a nicely formatted hours-minutes-seconds.
An example:
... which gave (at time of testing) ...
[VBScript] Classes, classes, classes
Over at Win32Scripting where I've been hanging out of late, some bright spark, Tony Hinkle by name, put up code to
"Use IE as an output device! This script is an example of how to make a DIV element an object and then change the innerHTML property. This is a vbs file, not an .asp file. ..."Being adventurous, I turned it into a class and added a bit of WMI to get the screen dimensions. And some test code which puts boxes at 9 different points on the screen:
Labels:
class,
dialogs,
IEDisplay,
Internet Explorer,
packing manager,
Tony Hinkle,
VBScript
Thursday, August 25, 2005
[VBScript] Classes in VBScript, the definitive article?
| Article Information | |
|---|---|
| Article Title: | 4GuysFromRolla.com - Using Classes within VBScript |
| Article Author: | Mark Lidstone |
| Published Date: | Thursday, September 23, 1999 |
| Article URL: | http://www.4GuysFromRolla.com/webtech/092399-1.shtml |
Labels:
4GuysFromRolla,
class,
VBScript
[VBScript] Changes to existing stuff
Just a couple of changes. To the Container class I've added
and I forgot to include the DQuote for PArray
public sub Clear
redim vat(0)
itemCount = 0
end sub
and I forgot to include the DQuote for PArray
Function DQuote( aText )
DQuote = Chr( 34 ) & aText & Chr( 34 )
End Function
[VBScript] My first class
A "Container" class, which I can add stuff to and then pull it all out nicely Join()-ed or else as a raw array.
And the nice thing is I can have multiple collections rather than the single instance thing I had a couple of days ago. Some test code ran like this:
Subscribe to:
Posts (Atom)