Tuesday, December 2, 2008

Buzzword Generator

Awhile back I wrote a buzzword generator in VBA.  Here's the version I use for either generating a spreadsheet with 500 buzzwords or to generate one as a popup.

Feel free to use the code:

 

Private Function RandomizedNumber( _
intLow As Integer, intHigh As Integer)
Randomize
RandomizedNumber = Int((intHigh * Rnd) + intLow)
End Function

Public Sub MSGME()
' Returns a message box with one buzzword
MsgBox ReturnBuzzword3
End Sub

Public Sub Create500()
' Creates 500 buzzwords on the CURRENT sheet
Dim x As Integer

For x = 1 To 500
Cells(x, 1).Value = ReturnBuzzword3
Next x
End Sub

Private Function ReturnBuzzword3()
Dim varColumn(210, 1) As Variant
Dim intI As Integer,
DIM int1 As Integer, int2 As Integer, int3 As Integer
Dim blnContinue As Boolean
' Use this space to load array with adj, verbs & Nouns
Do Until blnContinue = True
int1 = RandomizedNumber(0, UBound(varColumn))
int2 = RandomizedNumber(0, UBound(varColumn))
int3 = RandomizedNumber(0, UBound(varColumn))
blnContinue = False
If (int1 <> int2) And (int1 <> int3) And (int2 <> int3) Then
If ((varColumn(int1, 1) = "adverb") Or (varColumn(int1, 1) = "verb")) _
And (varColumn(int2, 1) = "adjective") _
And (varColumn(int3, 1) = "noun") Then
blnContinue = True
End If
End If
Loop
ReturnBuzzword3 = varColumn(int1, 0) & " " & varColumn(int2, 0) & " " & varColumn(int3, 0) & " "
End Function



Labels: , ,

Friday, September 7, 2007

Prepositions

I looked up the word "preposition." I had been thinking of the rule that states that a sentence should never end with a preposition. I discovered the rule is false. Apparently the rule is true for Latin and was ported over and applied to English erroneously.

I especially like Winston Churchill's quote (in the "usage note" section):



Preposition

prep·o·si·tion [prep-uh-zish-uhn] –noun Grammar.
any member of a class of words found in many languages that are used before nouns, pronouns, or other substantives to form phrases functioning as modifiers of verbs, nouns, or adjectives, and that typically express a spatial, temporal, or other relationship, as in, on, by, to, since.

Usage Note: Usage Note: It was John Dryden who first promulgated the doctrine that a preposition may not be used at the end of a sentence, probably on the basis of a specious analogy to Latin. Grammarians in the 18th century refined the doctrine, and the rule has since become one of the most venerated maxims of schoolroom grammar. But sentences ending with prepositions can be found in the works of most of the great writers since the Renaissance. English syntax does allow for final placement of the preposition, as in We have much to be thankful for or I asked her which course she had signed up for. Efforts to rewrite such sentences to place the preposition elsewhere can have stilted and even comical results, as Winston Churchill demonstrated when he objected to the doctrine by saying "This is the sort of English up with which I cannot put." Sometimes sentences that end with adverbs, such as I don't know where she will end up or It's the most curious book I've ever run across, mistakenly thought to end in prepositions. One can tell that up and across are adverbs here, not prepositions, by the ungrammaticality of I don't know up where she will end and It's the most curious book across which I have ever run. It has never been suggested that it is incorrect to end a sentence with an adverb.

Labels: ,