IsNumeric Alternative (VB Function)

Visual Basic Projects No Comments »

Here's an original idea I came up with as a replacement to the built-in VB IsNumeric function. It gives you complete control over what you consider a number to be. For example, let's say you pass the value $3,207.37 to isNumeric. Now normally this would return true, but what if you didn't want it to return true. What if you wanted it to count the comma and period as a number, but not the dollar sign (i.e. 3,207.37 is a number and $3,207.37 is not). Well normally you wouldn't be able to do anything about it, but with this function you are able to decide which individual characters you think are numeric and which characters you think are not numeric. This function allows you to pass as many characters as you want after the number specifying what you consider a number to be. For example, if you consider the comma (,) and the dollar sign ($) to be "a number", then you would say isNumeric2("333.33", ",$"). After you pass it the initial number (either in string or non-string form), you pass it all of the characters you consider to be numeric in one string, so if you consider the comma, dollar sign and percent sign to be numeric you would say: isNumeric2("$500.23%", ",$%"). And this function will return true (if the number is numeric) and false (if the number is not numeric). Feedback and comments are welcome.

Download is_numeric_alternative.zip (June 11, 2005)


Read the rest of this entry »

Extract Only Numbers (VB Function)

Visual Basic Modules 2 Comments »

Here's a Visual Basic function I wrote called extractOnlyNumbers which returns the numeric only parts of a string. For example, extractOnlyNumbers("123a4") would return 1234 (as a double). If you decide to pass it the second parameter (stop_at_non_numeric), then it will stop processing when it reaches a non-numeric character so extractOnlyNumbers("123a4") would return 123 (as a double). This second parameter is optional, if you don't pass it then it will process all characters.

Download extractOnlyNumbers.bas (May 31, 2006)

Read the rest of this entry »

Get Data Type (VB Function)

Visual Basic Modules No Comments »

Here's a Visual Basic function I wrote called getDataType that returns a string representation of the passed item's data type. This is different from VarType in that VarType returns an integer, and this returns a human readable string. I know this is similar to the TypeName function but this is just my spin on it.

Download getDataType.bas (May 31, 2006)

Read the rest of this entry »

Word Combination Maker

Adwords Tools, Visual Basic Projects 8 Comments »

Here's the source code to a Visual Basic project I originally wrote on June 06, 2005 called "Word Combination Maker". This is somewhat similar to my Word Combiner program. This program has to do with string permutations (or rather the permutations of words). It takes a series of words and it can tell you all the different possible ways those words can be re-arranged. Here's an example, let's say I type "A B C". This is composed of 3 individual words (A, B, and C). This can be arranged 6 different ways: "ABC, ACB, BAC, BCA, CAB, CBA". Well that's easy to understand but what about for 4 words, or 5 words? There's a lot more combinations as the number of words grow (it grows exponentially in fact). It can get pretty complicated by hand, so that's why I wrote this program. It would probably be most useful for people advertising on PPC advertising programs like Google Adwords because it allows you to pick out certain keywords and phrases that you can bid on "exactly". All the different ways of combining a series of words can be found with this program. Feedback and comments are welcome.

Download word_combination_maker.zip (June 06, 2005)


Read the rest of this entry »

Visual Basic 6 Data Type Reference

Visual Basic Reference No Comments »

After spending a great deal of time compiling information from the MSDN and other various online and offline sources I've put together the chart you see below which details all of the different data types available in Visual Basic 6. It includes their min/max values, storage size, and other useful information such as conversion functions and a list of VbVarType constants. If you're looking for other reference material for Visual Basic I also have a VB KeyAscii Chart, a VB KeyCode Chart, and a VB KeyCode Constants Chart.

Download vb_datatype_reference.txt (July 17, 2008)

Read the rest of this entry »

Entries RSS Comments RSS Log in