Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Make Words Out Of Letters


if i had 1000,s of different words in an array and i wrote a bunch of jumbled up letters in a textbox, how would i go about checking the the array to see if i could make a word out of the letters in the textbox.

thank you.
casey.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Words And Letters
Hi!

I have an array with letters L(10) and an empty array W()
I need all possible combinations of these letters to fill W()
I know I need some algorythm but I am not so good in programming such things.

For Example I have:
L(1)="A"
L(2)="B" (I just have two letters)
So:
W(1)="A"
W(2)="B"
W(3)="AB"
W(4)="BA"
...

Help Please
Thanks in Advance
Artemi

Replacing Letters/words
Ok, I'm not exactly sure how to explain what I'm trying to do, but I'll give it a shot. I'm attempting to make a translator program consisting of a a text box, button, and label. The user will type something in the textbox, click the button, and it will appear in the label. However, when it appears in the label I want certain letters to be replaces by other letters, and certain words replaced with other words. I doubt this is a simple task, so any examples or links to tutorials would be great. Thanks.

How To Split Into LETTERS Not Words
How do you use the split function in such a way that it splits your sentence into single letters and spaces, and not words like it does by default? I'm thinking it has somethign to do with the delimiter...

Thx!

Having XXX Letters And Trying To Match Them With XXX Words.
Not a big importance here, more out of curiosity...

Basically, lets say you have asdfghjkl and need to find every word possible (which is in a .txt file with thousands upon thousands of words).

How would you go about to get all the possible words?

My method would be fist to make a loop that cycles through all the words one at a time (how? I do not know maybe setup each letter in a array and increase that array value + check to make sure there are no duplicate(s)) then inside that loop id have all the words loaded into a other array (can vb handle that many words?) and then <if> check them one at the time inside the loop...

That method might work but there are some problems I foresee:
a) Would take hella long with no indication when it will finish, and my form never refreshed on my old computer in this type of <intense> loop.
b) Can vb handle +50 000 variables (with about 1-10 bytes each)? (what method is quickest?)

Now for my question: What do you think? Is there a better method and quicker method (other then not using vb :P)

Finding Words Between Letters
How do i find a word between <hi> <hi> And store it into a variable ??

Check For Common Letters In 2 Words
how to check the common letters between 2 words? my equal sign doesn't work because capital letters are greater than small letters. but i want to disregard that.

sample:
first=vIsual
second=baSic
commonletters=i,s,a

Finding Words Using Letters In Labels
Any ideas how I would have a program find words from a word search.

Say I have a word search, and I entered a word into a text box. I want the program to find the word in the word search which I have created. (The computer find it now me).

I plan to create the word search using single letters in labels.

I am a total beginner so please so technical terms, lol.

Seperating Letters And Words In A Sentance
Hello everyone, this is my first post to this forum and I'm excited to get underway.

Anyways. I'm in the process of making my senior project and I am almost completed. There is only one thing holding me back!

Is there a way to take text from an input box, then extract the individual words/letters and store them in an arraylist?

I've exhausted other resources, so I'm really hoping that the populous here can be of assistance.

I'm using Visual Basic 2005 Express Edition.

Thanks in advance to anyone that helps me.

~Vaune

Generate Words From A List Of Letters
I am attempting to write a program that will take a list of letters (i.e., asdfjkleirugh) and create words (i.e. sad, self, dark, dad, fail, etc.). I want it to be able to create words from 2 to whatever number of letters the user specified. This is what I came up with:


VB Code:
Dim a1 As LongDim a2 As LongDim a3 As LongDim a4 As LongDim ConstCombo1 As StringDim ConstCombo2 As StringDim ConstCombo3 As StringDim VolCombo1 As StringDim WordCombo As String For a1 = 1 To 10    For a2 = 1 To 4        For a3 = 1 To 10            For a4 = 1 To 10                ConstCombo1 = Choose(a1, "s", "d", "f", "j", "k", "l", "r", "u", "g", "h")                VolCombo1 = Choose(a2, "a", "e", "i", "u")                ConstCombo2 = Choose(a3, "s", "d", "f", "j", "k", "l", "r", "u", "g", "h")                ConstCombo3 = Choose(a4, "s", "d", "f", "j", "k", "l", "r", "u", "g", "h")                                WordCombo = ConstCombo1 & VolCombo1 & ConstCombo2 & ConstCombo3            Next a4        Next a3    Next a2Next a1


Any ideas? Thanks

Code To Find All Possible Words W/ Set Of Letters...
I need some help with a project...

I need to write a program that will take a set of letters (5 or 6) and find all of the possible words with that set of letters...

The words can't just be as long as the set of letters...

I was thinking of using the Microsoft Office dictionary to find the words, but I'm not exactly sure of where to start with the coding...

My questions are...

1) How do I access the dictionary that comes with Microsoft Word and such...

2) Do I need to setup arrays to find all possible combinations of the letters? If so, can someone give me an explination of the setup...

Thanx for your support,
Squirrelly1

Searching For Words Or Letters In A Sentance
I need some sort of code that...well heres some sor of an idea

if "Hello" is in "HelloHello" then
etc
end if

Loop To Create All Possible Words From String Of Letters
I have been racking my brain, and can't come up with the best solution on how to do this. I want to be able to input six letters and create every possible combination of 3, 4, 5, and 6 letter words. Only using each letter once, and then check each combination against a word list to see if any of them are real words.

Does this make any sense? Does anyone have any clue where to point me to get started?

Thanks,
Oabie

Counting Letters And Words Visual Basic
Hi

Another task set by school i need to take as input one line of text which is:

The Cat Sat On the Mat

and count how many words, letters and characters are in the sentence.

How do i go about starting this.

When i get more familiar with VB i should be able to do this well but i have only just started and I am not really quite sure..

Please help me.

Thanks

Counting Words And Letters In Open File
Hello ,

How would I go about counting every letter and words in a txt file after I open the file up?

How To Count Words, And Individual Letters In A Word?
People, new here. Got a question to ask.

How to count words, and individual letters in a word? from a textfile?

Comparing Texts With Missing Or Extra Letters(words)
Hey all,
my problem is when I start to compare two texts with different lenght.
The point is that the texts are loaded in two RTB and I don't know how to compare them.
I found that I have to split the strings and then to compare word by word,but it's hard for me because (as default),these RTBoxes are empty and user put the texts from files.
I'll appretiate your help!

How To Make Some Words Move Up To Down Or Down To Up?
I wonder how to make some words or sentences move up to down or down toup in VB 6.0 ?

Any one have some hints?

Thank u

How Can You Make VB Spit Out Random Letters/lengths
i need a bit of help with something; i need to compile some code that will spit out random letters (A-Z), and spit them out at random lengths. The code that i'm using to spit out random numbers (this is a set length, no randomized lengths) is this:


Code:
Randomize
ii = Int(Rnd * 99999999999999#)

anyone that holds sample code would be of great help

How To Make The Straight The Animation Of Falling Letters?
I greet all. I'm here new and I live in Poland. I on beginning want all to excuze oneself for my English. It's disastrous and the bad. I have hope that I will be understood well. O. K?
And now to thing.
Mad idea fell me to head, because wonder recently over falling severally signs, with sounds. The characters fall, one after second of different sides, with rumble. Hmm, or you understand me? Last characters comes running at the sound of inhibitory car. Does someone have some idea as to execute this? All together characters create the name of application and show the author name. This can be the quite good animation of little window ABOUT.
Please read and prompt it can with example - code, I thank.


P.S.
I forgot adding, I want to use the sound files of type the wave.

Make Text Boxes Permanently Capital Letters?
As regards text boxes, is there a way to make sure the user permanently only uses capital letters?

Need Help To Make First Letter Of All Words In A Textbox To Uppercase
so, i have this code to convert first letter of word to uppercase:


Code:
Private Sub txtFields_Change(Index As Integer)

txtFields(Index).Text = UCase$(Left(txtFields(Index).Text, 1)) & LCase$(Mid$(txtFields(Index).Text, 2))
txtFields(Index).SelStart = Len(txtFields(Index).Text)
End Sub
but, this was before i realize that i'm actually working with textboxes where more than two words are entered, i need some help with this code so that first letter of all words in a textbox will become uppercase...

anyone, pls? tnx.

Wanna Make A Program To Learn Abt Words
Hi

I want to make a program which count the total number of words which can generate by the given words.

Example:

Given word is : Pen

Result should be:

Pen
Pne
Npe
Nep
Epn
Enp


Please any one can help me to do this

Thank you

Making A Button Make Words Appear But Not Run Off The Text Area
When I put a command button and make it to where the button says something in a text box, the text just runs right off the text area when it's too long. is there a way to prevent this?

How Do I Make My Program Count The Amount Of Words In A Text Box?
How do I make my program count the amount of words in a text box?

'How To Make Search Find Words No Only At The Beginning But Also In The Middle Of The
Code:

'How to make Search find words no only at the beginning but also in the middle of the line?
Private Sub btnFindMachine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFindMachine.Click
Dim srchWord As String
Dim wordIndex As Integer
srchWord = InputBox("Enter the Machine Address to search for")
wordIndex = lstListMachines.FindStringExact(srchWord)
If wordIndex >= 0 Then
lstListMachines.TopIndex = wordIndex
lstListMachines.SelectedIndex = wordIndex
Else
wordIndex = lstListMachines.FindString(srchWord)
If wordIndex >= 0 Then
lstListMachines.TopIndex = wordIndex
lstListMachines.SelectedIndex = wordIndex
Else
MsgBox("Machine Address " & srchWord & " is not in this list")
End If
End If
End Sub

Searching A Field For:exact Match/any Of Words Contained In/any Words In Any Order?
I have a simple search running but I've found it to be pretty useless so far.

I'm not overly sure how search engines operate (ie. in their basic search, they seem to find your search string in records/fields where 2 or more words match), but maybe someone can enlighten me how to do this ?

I am trying to search a string for matches in one particular field, Can anyone help me alter my code so that it searches for:

-An exact match of search string to the field (Match exact phrase)

-A match where any of the words given are contained in the field in any order
(Match any word)

-A match where all of the words given are contained in the field (but maybe not having to be in the order they were given).

-A match where any of the words given are contained in field in similar order
(ie. If user entered "I am really confused" as the search string, it could pick out records that had strings such as "I am" or "really confused").

I know I may need a combo box for this, or cases, but can someone please guide me in the right direction as regards the queries?

My code so far is:


Code:
newMatchRS.Open "SELECT * From Task WHERE UCase(TaskInformation)
LIKE '%" & UCase(txtSearchCriteria) & "%' Order By TaskID", db,
adOpenStatic, adLockOptimistic
Thanks for any help

Searching A Field For:exact Match/any Of Words Contained In/any Words In Any Order?
I have a simple search running but I've found it to be pretty useless so far.

I'm not overly sure how search engines operate (ie. in their basic search, they seem to find your search string in records/fields where 2 or more words match), but maybe someone can enlighten me how to do this ?

I am trying to search a string for matches in one particular field, Can anyone help me alter my code so that it searches for:

-An exact match of search string to the field (Match exact phrase)

-A match where any of the words given are contained in the field in any order
(Match any word)

-A match where all of the words given are contained in the field (but maybe not having to be in the order they were given).

-A match where any of the words given are contained in field in similar order
(ie. If user entered "I am really confused" as the search string, it could pick out records that had strings such as "I am" or "really confused").

I know I may need a combo box for this, or cases, but can someone please guide me in the right direction as regards the queries?

My code so far is:

Code:
newMatchRS.Open "SELECT * From Task WHERE UCase(TaskInformation)
LIKE '%" & UCase(txtSearchCriteria) & "%' Order By TaskID", db, adOpenStatic, adLockOptimistic


Thanks for any help

How To Make Users Enter Right &"words&"
i know i need to make use of a certain string function but should i want to make sure that the user enters "female" or "male" regardless if it's in ucase or lowercase or have it mixed just as long as the letters correspond to those two words, what do i do?

this should be that when the user enter a word other than "Female" and "male", a prompt is given to the user to only enter "female" or male

help. tnx.

How To Change Letters Into Differant Letters
hi i want to be able to enter text into a text box and click a button and have certain letters changed into other letters e.g

ABCD to AGYU

How To Display Upper Case Letters In Text Box While Pressing Lower Case Letters
I want to Display Upper Case Letters in Text Box while Pressing Lower Case Letters, I tried with

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii >= 65 And KeyAscii <= 122 Then
    Text1.Text = UCase(Text1.text)
End If

End Sub

but it is printing in reverse , is there any other mothods.


Thank you.

Substitute Words In A Textbox With Other Words Help??
Hello all,

I have a project that has 2 text box's and a command button on a form. In one text box is a quote and in the quote one of the words is *****. The other is blank. I would like to be able to type a word in the blank text box and then press the command button and have that word replace the ***** in the quote. is this easy to code?

thanks in advance for any help you can give.

How Do You Make A Program Where Your Built-in Words Like &"hey&" Or &"blah&" Go In Order?
Like a compiler, when you are going to put a word like "make_blah" then it appears in a column with other words that are near that alphabetical order.

Bubble Sort: Have Two Words Sorted, How To Sort Third Word With The First Two Words
After a person types in a different word into three seperate textboxes, I can sort two words in alpha order ... my inquiry is how do I sort a third word with the first two words?

This code sorts two words fine, but do not know how to add in the third word into the "If" routine ...


Code:
Private Sub cmdAlpha_Click()

Dim FirstWord As String
Dim SecondWord As String
Dim ThirdWord As String
Dim temp As String

FirstWord = txtFirstWord.Text
SecondWord = txtSecondWord.Text
ThirdWord = txtThirdWord.Text

' *** the third word would go in here somehow?? ***
' *** or would the method have to change to accomodate a third word?? ***
If FirstWord > SecondWord Then
temp = FirstWord
FirstWord = SecondWord
SecondWord = temp
End If

picAlphaDisplay.Cls
picAlphaDisplay.Print FirstWord & vbNewLine & SecondWord & vbNewLine & ThirdWord & vbNewLine
End Sub
Would someone show me how please? Thank You.

Bubble Sort: Have Two Words Sorted, How To Sort Third Word With The First Two Words
After a person types in a different word into three seperate textboxes, I can sort two words in alpha order ... my inquiry is how do I sort a third word with the first two words?

This code sorts two words fine, but do not know how to add in the third word into the "If" routine ...

Code:
Private Sub cmdAlpha_Click()

Dim FirstWord As String
Dim SecondWord As String
Dim ThirdWord As String
Dim temp As String

FirstWord = txtFirstWord.Text
SecondWord = txtSecondWord.Text
ThirdWord = txtThirdWord.Text

' *** the third word would go in here somehow?? ***
' *** or would the method have to change to accomodate a third word?? ***
If FirstWord > SecondWord Then
temp = FirstWord
FirstWord = SecondWord
SecondWord = temp
End If

picAlphaDisplay.Cls
picAlphaDisplay.Print FirstWord & vbNewLine & SecondWord & vbNewLine & ThirdWord & vbNewLine
End Sub

Would someone show me how please? Thank You.

Random Letters(not A Question On How To Generate Random Letters)
Hi,

My question is pretty straight forward...basically I'm generating random letters a - z and numbers 0 - 9...

I also have a combobox with numbers from 1 to 10 (which will be used to determine the length of the string ,ie,user picks 5,which should produce a list of random letters and numbers in a listbox

ts7gx
s93ks
3js9f
sxs0f

and so on and so on )

This is where my question begins ..

instead of using something like this :



Code:
Option Explicit
Dim schars as string
Dim sChar as string
Dim lchar as string
Dim tchar as string
Dim pchar as string


Private Sub Command1_Click()
lstnames.Clear

For i = 1 To txtamount.Text ' used to generate 1 to whatever number is typed into txtamount.text

schars = Chr$(Asc("a") + Int(26 * Rnd()))
sChar = Chr$(Asc("0") + Int(9 * Rnd())) + 1
lchar = Chr$(Asc("0") + Int(9 * Rnd())) + 1
tchar = Chr$(Asc("a") + Int(26 * Rnd()))
pchar = Chr$(Asc("a") + Int(26 * Rnd()))

if cbolength.text = "5" then

lstnames.AddItem schars & sChar & lchar & tchar & pchar 'which should procude a five character string.

end if

Next i
End Sub


would there be an easier/neater way of making the string 5 characters/numbers long(for example)without having to concatenate each variable,or even use that many variables to begin with ?

Coverting Words To Other Words
I am seeking help for a program I am trying to make. First Off, my goal is to make a converter that will convert words you type in to another word... As in
If I typed In "and" and wished to convert it to "plus" or "also".... How would I go about doing this. My second question is.. If the first part was completed.. how would I make the converter use 2 to 3 options of a word to convert to....... example... If I had a paragraph with about 12 "then" words in it.. I would possibly want to use a variety of words like that.. so I would enter the paragraph into the converter and it would convert all of the "then" words to a conversion of random words Like "after" or "later"

Another example:
Before: Then he went to the park. Then he drove his car. Then he went home.

After. Then he went to the park. After he drove his car. Later he went home.

Is there any way of doing this?? The first question being answered is fine.. the second is just something that could be added. Thanks

How To Convert Ascii Codes To Letters, And How To Uncode Letters To Ascii Codes?
how to convert ascii codes to letters, and how to uncode letters to ascii codes?
eg 65=a
a=65

Letters Only
Is it possible to tell whether or not a textbox contains letters only versus having number/symbols?

Like:

If Text1 = LettersOnly Then
MsgBox "Letters"
Else
MsgBox "Not Just Letters!"
End If

How Many Certain Letters
how would you find out how many letter "t" are in text1 textbox. it doesnt matter if it is lower case or upper case though.

thanks

Letters
does vb 6 have the functionality to create letters, as in it will pull names and addresses from the database, and the user can write in the content, and they can be printed then?
Any ideas, links
Thanks inadvance
Finbarr

Value For Letters
my code is as follows. the bold part i'm not sure about

Dim Letter As Long
Dim A As Long
Dim Square As String

For Letter = A To Val(txtLetter.Text)
lbl1.Caption = lbl1.Caption & Square
Next Letter

If txtLetter.Text = "A" Then
lbl1.Caption = lbl1.Caption & Square
End If



Square = "Hello" & vbNewLine & "how" & vbNewLine & "are" & vbNewLine & "you" & vbNewLine & "today"


ok. so when i just use the for/next statement, any letter inputed (doesn't matter if it's A) will automatically display square's message. but when i use the if/then statement, even if i enter in A, nothing will be displayed.

Letters
Hi,

I have a txt feild. The user is to only input numbers and characters like :;'" etc. but no letters. I am able to make it work by doing this. .


If txtSTUFF = "a" or txtSTUFF = "b" etc then
msgbox("NO LETTERS")
END IF . . .

but this is long and ugly, and the lower case letter statements don't even fit on the same line with the upper case statements.

Is there an easier way to do this??? My way works, but it is really annoying. If it were with numbers I could do some other stuff, but the letter aspect has me stumped.

Thanx

EC

Letters?
Quick question.

# = numbers.

is there a character that represents letters?

thanx.

Letters Only
I have a a text box now i only want letters in it.
I have two option buttons. One says Surname and one says DCN. now when the surname button is clicked i want the textbox(text1) to allow only letters and no other character?

code

Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
If EHPID.Value = True Then
Adodc1.RecordSource = "SELECT CFR_DCN,CFR_LINSEQ,CFR_PATNAME,CFR_PATDOB,CFR_EHPID,CFR_SCDCODE,(Val(CFR.CFR_ALLOWED))/100 AS CFR_ALLOWED,(Val " _
& "(CFR.CFR_DEDUCT))/100 as CFR_DEDUCT,(Val(CFR.CFR_COINS))/100 as CFR_COINS,(Val(CFR.CFR_OTHER))/100 as CFR_OTHER,(Val " _
& "(CFR.CFR_COBAMT))/100 as CFR_COBAMT,(Val(CFR.CFR_PAID))/100 as " _
& "CFR_PAID,CFR_REASONCODE,CFR_PRNAME,CFR_SCANBATCHID,CFR_PROCESSDATE FROM CFR WHERE CFR_DCN = '" & Text1 & "' "
Adodc1.Refresh
ElseIf Lastname.Value = True Then
Adodc1.RecordSource = "SELECT CFR_DCN,CFR_LINSEQ,CFR_PATNAME,CFR_PATDOB,CFR_EHPID,CFR_SCDCODE,(Val(CFR.CFR_ALLOWED))/100 AS CFR_ALLOWED,(Val " _
& "(CFR.CFR_DEDUCT))/100 as CFR_DEDUCT,(Val(CFR.CFR_COINS))/100 as CFR_COINS,(Val(CFR.CFR_OTHER))/100 as CFR_OTHER,(Val " _
& "(CFR.CFR_COBAMT))/100 as CFR_COBAMT,(Val(CFR.CFR_PAID))/100 as " _
& "CFR_PAID,CFR_REASONCODE,CFR_PRNAME,CFR_SCANBATCHID,CFR_PROCESSDATE FROM CFR WHERE CFR_PATNAME LIKE '" & Text1.Text & "%'"
Adodc1.Refresh
End If

If Adodc1.Recordset.EOF = True Then
MsgBox "We didnt find any matching records-- Please try again"
Text1 = ""
Me![Text1].SetFocus
End If

End If
End If
End Sub

LEtters
Is there away to do this say o press "G" and it will type l in over words change the keyboard settins around any one got code!!

Letters
does vb 6 have the functionality to create letters, as in it will pull names and addresses from the database, and the user can write in the content, and they can be printed then?
Any ideas, links
Thanks inadvance
Finbarr

Letters Only
I need to validate my name and address text box to allow in characters such as letters, spaces and other symbols.

Seperating Letters.
Well im working on a OCR, and the image is made up of 2 letters and a number its set out like this

V2R or something like that number is always in the middle. The problem is the letters over lap, this seemd like a problem at first but it isnt, because the number is always a different colour. I stil dont no how to seperate the letters. any ideas?

Deleating Letters
I have a typing program being made and i can not find out how i can delete the first charecter when the key is pressed i got the keyascii code set up for all leters and numbers but i just ant delete a leter from a label

Copyright 2005-08 www.BigResource.com, All rights reserved