Visual Basic 6.0 (VB6) is the "third-generation" event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model. It was also considered a relatively easy programming language to learn and use, because of its graphical development features ...

learn more… | top users | synonyms

12
votes
1answer
83 views

Shared VB6 *and* VBA extensibility add-in with OnConnect and OnDisconnect handling

Rubberduck works well enough when the VBE is of the VBA variety, but it currently only works when the Rubberduck is configured to load at VBA start-up, and it has a tendency to crash the host ...
9
votes
1answer
242 views

Multi-dimensional array sort and filter functions

As I said in my last post Multi-dimensional ascending and descending sort array function, I'm back with the final version of the code. Added features: Filter array function by following parameters: <...
3
votes
2answers
65 views

Implementation of the Access version DBLookup() in VB6

I've tried to implement the access function DBLookup() in VB6 for a project I'm doing. Does anyone have comments on how well done it is and what could be improved? ...
7
votes
1answer
135 views

Growing my own Tree (Structure)

Summary VB6 doesn't have a great selection of data structures to work with, so again I find myself creating my own. I have a need to dynamically generate a directory structure on the file system. The ...
2
votes
1answer
3k views

Calling Stored Procedures with Lots of Parameters

I have this piece of code for running a Stored Procedure, and I was wondering if there is a way of cutting code like: ...
4
votes
1answer
624 views

Converting to Roman Numeral with Recursive Algorithm

Summary I'm getting ready to dive back into a "more proper" project, so I wanted to take a moment to get my TDD hat on before doing so. I decided to tackle this Roman Numeral Kata for practice. The ...
11
votes
3answers
2k views

Building a better Collection. Enumerable in VBA

VBA's 'Collection' is.... lacking, so, I've been working on a better Collection object that implements many of the features of C#'s Enumerable. This is very much inspired by this question and a follow ...
8
votes
2answers
312 views

No more Fizzbuzz. How about Hello World instead?

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both ...
7
votes
2answers
854 views

Generating Random RGB Colors

I have a function for generating RGB colors in VB6.0, and it is working properly. Please suggest improvements for this, if any. ...
4
votes
2answers
164 views

Extract a character at particular place in a string

I have a function: ...
8
votes
1answer
2k views

Extending the VBA Extensibility Library

The Microsoft Visual Basic for Applications Extensibility library let's us meta-program VBA, but the way it handles (or rather, doesn't handle) getting to the actual subs and functions is clunky at ...
12
votes
2answers
531 views

File reader/writer (text)

Following-up on this post, I wanted to be able to use my FileWriter with a syntax reminiscent of .net's using blocks, which ...
8
votes
3answers
299 views

FileWriter supporting writing to multiple files

I got bored with opening and closing files whenever I need to write to one, so I wrote a FileWriter class that's used like this: ...
5
votes
1answer
207 views

Recursively searching the Windows Registry

This function is part of a the Registry class that can be found on Google Drive. The class was originally written by Steve McMahon for VB6, but I ported it to VBA ...
8
votes
2answers
650 views

Materializing any ADODB Query

Following-up on Creating ADODB Parameters on the fly and pushing the "wrapping" of ADODB a step further, I have written two more classes that allows me to expose methods that don't require a ...
17
votes
4answers
8k views

Creating ADODB Parameters on the fly

I have put together a small wrapper class to simplify creating parameterized ADODB queries with VB6/VBA. At this point I'm keeping things simple, so it's only supporting input parameters and from what ...
6
votes
1answer
899 views

Dictionary<TKey, TValue> Implementation

This class encapsulates a List<KeyValuePair> (see List<T> implementation here, and ...
4
votes
1answer
655 views

KeyValuePair implementation

In order to implement my own Dictionary<TKey, TValue> in VB6, I've implemented a KeyValuePair class, which can accomodate ...
10
votes
5answers
1k views

Testing code with Debug.Assert

I have a small little function in a VB6 codebase: ...
11
votes
2answers
569 views

Nullable<T> Implementation for VB6/VBA

Because I was spoiled with C# and the .NET framework, whenever I have to work with VB6 I feel like something's missing in the language. A little while ago I implemented a ...
7
votes
1answer
235 views

Revisited IsTypeSafe method implementation for “type-safe” List

Following up on List<T> implementation for VB6/VBA, I'd like some thoughts about the revisited IsTypeSafe function, below. The previous version pretty much ...
27
votes
3answers
5k views

List<T> implementation for VB6/VBA

Recently I decided VB6's Collection wasn't enough for my needs, so I decided to implement something like C#'s List<T>. ...
12
votes
3answers
1k views

A CSharpish String.Format formatting helper

A while ago I implemented .net's string.Format() method in VB6; it works amazingly well, but I'm sure there has to be a way to make it more efficient. I'll start ...
5
votes
1answer
299 views

A more readable InStr: StringContains

Consider the following: If myString = "abc" Or myString = "def" [...] Or myString = "xyz" Then In C# when myString == "abc" ...
3
votes
3answers
2k views

Converting base-10 numbers into base-26 letters

I'm writing something that basically takes a bunch of files and renames them into a nice format, such as pic_000.jpeg, ...
5
votes
2answers
1k views

Avoiding the 'possible loss of data' compiler warning

I'm writing a file I/O DLL in C++ which is going to be used from VB6. The interface is already fixed, and uses INT64/Currency as the general integer data type. Now I have this function: ...
6
votes
3answers
6k views

Is it a bad programming practice to declare variable in a loop?

Today, I came across a code example like the following: ...
5
votes
2answers
812 views

VB6: String Searching Performance

5 years ago, when i was in love with VB, I created this simple program to detect if a file is virus or not. What I'd like is to see if you can help me optimize it, ...
15
votes
3answers
1k views

Is this shuffling algorithm OK?

I'm making a "guess that tune" game in Visual Basic 6 that is supposed to play each song in a random order. Here is my code to do so: ...