Greetings Again, All!
I know a bit more of the back end of things than front. Every now and then I use wildcard to retrieve data via sql advantage, oracle, and of course, our beloved MS Access ;-) I can't seem to find a wild card that will work in VB 6.
in spl advantage Ic an ue a 'Sam%' to find all Sam(s) and '%Sam' for Sam like, Example Samuel would show up here. Is there such a thing in VB 6, recent searches and reading hve come up empty, VB in "twenty one days" is useless; any ideas!
Dököll
21 3417
Greetings Again, All!
I know a bit more of the back end of things than front. Every now and then I use wildcard to retrieve data via sql advantage, oracle, and of course, our beloved MS Access ;-) I can't seem to find a wild card that will work in VB 6.
in spl advantage Ic an ue a 'Sam%' to find all Sam(s) and '%Sam' for Sam like, Example Samuel would show up here. Is there such a thing in VB 6, recent searches and reading hve come up empty, VB in "twenty one days" is useless; any ideas!
Dököll
For got to post what I hd in mind, let's say it were: - Dim GoSplit As Variant
-
Dim strGetWords As String
-
-
FileName = "\usermate.txt"
-
f = FreeFile
-
Open App.Path + FileName For Input As 1
-
Do While Not EOF(f)
-
Line Input #1, strGetWords
-
GoSplit = Split(strGetWords, " ")
-
-
If strGetWords$ like "bus" <> 0 Then ' want bus but I also get bus from busted
-
'Is there anything to add here that would make only the instance of bus to pop up
-
-
'Adding asterisk as in "bus*" give me nada, not a thing...
-
-
Text4(8).Text = "bus"
-
End If
-
-
'What I hope to do make sure "busted" is not picked up since "bus" gets picked up from "busted"
-
-
I am posting this because I did find a solution. If you recall, I decided to set visibility to false for the text bx that would have carried "bus" if "busted" was found. The problem is I had an error 'procedure too large, proof that my if statement was out of this world. A wildcard woul greatly reduce my risks, I do not appreciate that pop up too much "Procedure Too LARGE!" what is that?
-
-
What are yur thoughts on this?
-
-
Dököll
-
-
You should check the online help for the Like operator, but I think you'll find the asterisk (*) is the wildcard character you're after.
You should check the online help for the Like operator, but I think you'll find the asterisk (*) is the wildcard character you're after.
I'll give it a whirl, many thanks...I'm surprised 'help' included with thr software did no provide much assistance. Will let you know...
I think I figured out why (*) as wildcard is not working through VB 6.0 Professional. Checked Knowledge base, my attempt is to grab what I want from a .txt file where text (lyrical conten) would be temporarily stored. VB does give me the option to use the Like operator but to retrieve from an access database (Recordset) or other. I should have been more specific (VB 6.0 Vs .txt file). I will shrink the code in hopes that'll do the trick. Thanks for your support and assistance. I'll post my findings here when found, should help us tackle this mistery...
Dököll
According to the doco...
Like Operator Example
This example uses the Like operator to compare a string to a pattern. - Dim MyCheck
-
MyCheck = "aBBBa" Like "a*a" ' Returns True.
-
MyCheck = "F" Like "[A-Z]" ' Returns True.
-
MyCheck = "F" Like "[!A-Z]" ' Returns False.
-
MyCheck = "a2a" Like "a#a" ' Returns True.
-
MyCheck = "aM5b" Like "a[L-P]#[!c-e]" ' Returns True.
-
MyCheck = "BAT123khg" Like "B?T*" ' Returns True.
-
MyCheck = "CAT123khg" Like "B?T*" ' Returns False.
I've just tested the second example in plain VB6, and it worked. I found that when looking it up in the MSDN doco, it had two entries - VB and VBA. As is (for some weird reason) so often the case, selecting VBA gave me the relevant info, while VB gave me the info relating to an SQL query.
According to the doco...I've just tested the second example in plain VB6, and it worked. I found that when looking it up in the MSDN doco, it had two entries - VB and VBA. As is (for some weird reason) so often the case, selecting VBA gave me the relevant info, while VB gave me the info relating to an SQL query.
Indeed, Saw it too, thought it to be helpful, but I have to admit I do not quite understand it, nor can I use it it seems. The txt file is added then read straight away. Seems like a wild card does not work for a .txt file, here is another protion of the code: -
Private Sub GtWords_Click()
-
-
If Text6.Text = "" Then
-
MsgBox ("Looks, you forgot to add a lyric please add lyrical text to continue!")
-
Text6.SetFocus
-
ElseIf Text6.Text <> "" Then
-
-
Open App.Path + "\usermate.txt" For Output As #1 'file is opened as inWrite because it is Writing back into the program
-
Write #1, , Text6.Text
-
-
Close #1
-
-
Dim GoSplit As Variant
-
Dim strGetWords As String
-
-
FileName = "\usermate.txt"
-
f = FreeFile
-
Open App.Path + FileName For Input As #1
-
Do While Not EOF(f)
-
Line Input #1, strGetWords
-
GoSplit = Split(strGetWords, " ")
-
-
'This helps record the whole text from Text6 andbe read to find words collected. As we exchange notes, I am begining to see perhpas, the text must be added already formatted, therefore no "bus" even though busted is found (busted is not among words to find in text. We're still looking...thank you by te way, for posting your example from the microsoft site, I think I'll plug in some of it, trweak it see what happens. Again I have yet to undertstand it:
The SQL command I will be using later on will support your helpful comment previously added, fuzzy a bit, I think I should be good. It looks as though this sort of a command will not work to grab the absolute value::::::::::::::Whoa, Do you know about abolutevalue in VB, I learned there was such athing. What if I looked for the abolute value in strGetWords$, would that do the trick. Gotta go....
Dököll, thanks for posting
Indeed, Saw it too, thought it to be helpful, but I have to admit I do not quite understand it, nor can I use it it seems. The txt file is added then read straight away. Seems like a wild card does not work for a .txt file
I'm afraid I couldn't really tell much from the code.
Could you give more detail on exactly how the Like operator "doesn't work"? Maybe it's something we can fix, because I've tested one or two of the samples from the documentation, and it definitely did work. I don't see how a text file being involved would affect it.
As for "abolute value" :- if you mean absolute value, then that is basically just a number without taking the sign into account. So for example, Abs(-3) and Abs(3) would both return the value 3. I don't see how it would apply to a string.
I'm afraid I couldn't really tell much from the code.
Could you give more detail on exactly how the Like operator "doesn't work"? Maybe it's something we can fix, because I've tested one or two of the samples from the documentation, and it definitely did work. I don't see how a text file being involved would affect it.
As for "abolute value" :- if you mean absolute value, then that is basically just a number without taking the sign into account. So for example, Abs(-3) and Abs(3) would both return the value 3. I don't see how it would apply to a string.
Right on point, I spoke too soon, thanks for replying. The like operator works when I send the words found to an Access database, whereby frequent hits to it, unsing a wildcard (*), grabs all instances of "bus" inthe database. The problem is before the text is formatted to reflect exactly what the program asked, the format is useless; it's as if pickingup a dictionary and looking up words. When GtWords button is pushed, the code I previously posted starts running, accompagnied by a series of if statements, as in this posted solution: Dim GoSplit As Variant Dim strGetWords As String
FileName = "\usermate.txt"
f = FreeFile
Open App.Path + FileName For Input As 1
Do While Not EOF(f)
Line Input #1, strGetWords GoSplit = Split(strGetWords, " ")
If InStrB(strGetWords$, "busted") <> 0 Then
Text4(9).Text = "busted"
convert_my_text="BUSTED
convert_me_modu.change_it_now 'this fires up my module named conert_me_modu
End If ''''''Additional if statements are added here,
My Module
Public convert_my_text As String
Public Sub change_it_now ()
If UCase(convert_my_text) = "BUSTED" Then
'first value performed
LyricalContentfind.Text4(9).Text = ""
'empty string works here, no need to set vsibilty to false
End If
End Sub
'This is working, but I will need to also tell VB the words I do not need it to find, thus busted. A wildcard, if it exists for searching a .txt file should do the trick, since searching the actual database "Bus*" does in fact give me "Bus", addded/found from different text, typed my son's "the magic school bus" grabbed "the wheels on the bus" as well from my database; this means, my recordset had two hits for bus...
If a 'something_wildcard' can be used for .txt, whether it picks up "bus" a number of times, the results will be specific to only "bus" not busted. I attempting vbTextCompare again, perhaps something's a miss. Oh! here is what my Like operator atttempt loked like: - If strGetWords$ Like "dancing" <> 0 Then
-
Text17(10).Text = "Dancing"
-
End If
'If you typed up godancing, you got dancing out of that. I gt an idea :-)
In a bit!
Oh! here is what my Like operator atttempt loked like: - If strGetWords$ Like "dancing" <> 0 Then
-
Text17(10).Text = "Dancing"
-
End If
'If you typed up godancing, you got dancing out of that. I gt an idea :-)
In a bit!
I suppose it might depend on the Option Compare setting, which I've never touched. But as far as I know, that Like comparison will return the same result as using the = operator. The whole point of Like is that it allows you to use wildcards to indicate patterns or unknown parts in the string. By the way, the <> 0 is pointless, as well. The only two values that might be returned from the Like comparison are True (-1) and False (0). You’d do better to say If strGetWords$ Like "whatever" Then
How's this for an idea? If you have a string and you want to check whether a specific word appears within it, say "dancing", and you don't care about the case (upper/lower), perhaps you could use this... - If Lcase(strGetWords$) Like "* dancing *"0 Then
-
…
-
End If
You might also want to try this, to account for words at the start or end of the string. - If Lcase(strGetWords$) Like "* dancing *" _
-
Or Lcase(strGetWords$) Like "dancing *" _
-
Or Lcase(strGetWords$) Like "* dancing" _
-
Then
-
…
-
End If
One thing I don't understand is this. If you have already used Split to separate the string into words, why don't you just loop through and use = to check each of them?
I suppose it might depend on the Option Compare setting, which I've never touched. But as far as I know, that Like comparison will return the same result as using the = operator. The whole point of Like is that it allows you to use wildcards to indicate patterns or unknown parts in the string. By the way, the <> 0 is pointless, as well. The only two values that might be returned from the Like comparison are True (-1) and False (0). You’d do better to say If strGetWords$ Like "whatever" Then
How's this for an idea? If you have a string and you want to check whether a specific word appears within it, say "dancing", and you don't care about the case (upper/lower), perhaps you could use this... - If Lcase(strGetWords$) Like "* dancing *"0 Then
-
…
-
End If
You might also want to try this, to account for words at the start or end of the string. - If Lcase(strGetWords$) Like "* dancing *" _
-
Or Lcase(strGetWords$) Like "dancing *" _
-
Or Lcase(strGetWords$) Like "* dancing" _
-
Then
-
…
-
End If
One thing I don't understand is this. If you have already used Split to separate the string into words, why don't you just loop through and use = to check each of them?
Genius, I was about to post yet another idea, but I think yours will work. I wanted to allow strGetWords$ to do the work but still be able to pick up say: - If strGetWords$ like " bus " <> 0 then
-
' By the way, I agree with you here, <> 0 was left behind with InstrB, decided to roll with it anyway. Now even though it is useless, could it screw up the code just being added in...I'll get rid o it nonetheless, just checking
-
-
GoSplit=strGetWords$(Trim(" bus ")
-
LyricalContentfind.Text4(8).Text ="Bus"
-
-
End If
-
-
I wanted to try this because if I were to trim spaces from left to right, VB would give me the exact word searched, not bus because of busted; bus because it was included in a phrase. I attempted * at both ends as well, but I did not have any spaces, looks like you have space after *, will go to it again. Appreciate your reply...
Genius, I was about to post yet another idea, but I think yours will work. I wanted to allow strGetWords$ to do the work but still be able to pick up say: - If strGetWords$ like " bus " <> 0 then
-
' By the way, I agree with you here, <> 0 was left behind with InstrB, decided to roll with it anyway. Now even though it is useless, could it screw up the code just being added in...I'll get rid o it nonetheless, just checking
-
-
GoSplit=strGetWords$(Trim(" bus ")
-
LyricalContentfind.Text4(8).Text ="Bus"
-
-
End If
-
-
I wanted to try this because if I were to trim spaces from left to right, VB would give me the exact word searched, not bus because of busted; bus because it was included in a phrase. I attempted * at both ends as well, but I did not have any spaces, looks like you have space after *, will go to it again. Appreciate your reply...
Thanks much for your post, looks like we're still battling againt this beast. I get dancing out of godancing -
-
'this helped a great deal, first of all, I can further minimize lines of code with this, then add more words, my client/buddy was helpeful and deleted gave me a new list of words, attempting to assist me with the 'Procedure too large' error I got earlier on.
-
-
If Lcase(strGetWords$) Like "* dancing *" _
-
Or Lcase(strGetWords$) Like "dancing *" _
-
Or Lcase(strGetWords$) Like "* dancing" _
-
Then
-
…
-
End If
-
-
'my previous syntax will probably work, not in thecurrent form, I am not sure what I wrote, the idea came to in a flash.
-
-
I wanted to try the above an I am glad I did. I think triminng spaces may work, works for tab delimited .txt files through sql advantage results, there's got to be a way to pin this to VB and it takes it, you know -)
Genius, I was about to post yet another idea, but I think yours will work. I wanted to allow strGetWords$ to do the work but still be able to pick up say:
Now you're making me blush! - GoSplit=strGetWords$(Trim(" bus ")
Um... I don't think that statement makes sense. Did you intend to include an Instr in there? As it stands, it looks as though you are trying to treat a string like a function. That might work in Java, but I don't think VB will be happy about it.
I wanted to try this because if I were to trim spaces from left to right, VB would give me the exact word searched, not bus because of busted; bus because it was included in a phrase. I attempted * at both ends as well, but I did not have any spaces, looks like you have space after *, will go to it again.
Yes, it's a little bit tricky. But the three variations I wrote should catch a word in the middle of a sentence, or at the start or end. But it should detect only whole words.
It might be a good idea to write a function which applies those three variations of the Like( ) function to a passed string, rather than coding it all the time. Then you can write more easily reasble code. For example... - If StringContainsWord(strGetWords$, "bus") Then ...
Now you're making me blush!
Um... I don't think that statement makes sense. Did you intend to include an Instr in there? As it stands, it looks as though you are trying to treat a string like a function. That might work in Java, but I don't think VB will be happy about it.
Yes, it's a little bit tricky. But the three variations I wrote should catch a word in the middle of a sentence, or at the start or end. But it should detect only whole words.
It might be a good idea to write a function which applies those three variations of the Like( ) function to a passed string, rather than coding it all the time. Then you can write more easily reasble code. For example... - If StringContainsWord(strGetWords$, "bus") Then ...
Not intended, I get all worked up when good ideas come about, well deserved. I think I'll try trim somehow but with a function I set up like you said, just to be sure I get what I want everytime, double-checking if you know what I mean. This is what I'll do now. OK, here is another idea that popped up, I trust trimming more though. What if, mind you the text is being added in the following fashion: -
Private Sub GtWords_Click()
-
-
If Text6.Text = "" Then
-
MsgBox ("Looks, you forgot to add a lyric please add lyrical text to continue!")
-
Text6.SetFocus
-
ElseIf Text6.Text <> "" Then
-
-
Open App.Path + "\usermate.txt" For Output As #1 'file is opened as inWrite because it is Writing back into the program
-
Write #1, , Text6.Text
-
-
Close #1
-
-
End If, Sub and so on
-
-
When/while it is being added, what if I add stuff to it, likequotation marks (" "), for instance: "the" "wheels" "on" "the" "bus". I remember having to do this to replace a word from astring. What are your thoughts on this? Could we do this then still search, I mean why not, right. I will be searching for the code here. Perhaps, not to replace "the" "wheels" "on" "the" "bus", but at least add characters (" ") to each word so that they are valid everytime, "bus", "rain", and so on. By the time you read this, I may think of something else but please stop me if you think I am heading to desaster.
Dököll
Not intended, I get all worked up when good ideas come about, well deserved. I think I'll try trim somehow but with a function I set up like you said, just to be sure I get what I want everytime, double-checking if you know what I mean.
Yes, the modular approach makes it much simpler to debug and test each part. And once your function is working and tested, you can reuse it without having to get it working again.
...What if, mind you the text is being added in the following fashion: ... - ElseIf Text6.Text <> "" Then
Actually, all you need there is Else.
By the time you read this, I may think of something else but please stop me if you think I am heading to desaster.
No disaster that I'm aware of. But I'm afraid I'm not really following very well.
Anyway, probably the best way to learn this stuff is to try it, and see what happens.
Yes, the modular approach makes it much simpler to debug and test each part. And once your function is working and tested, you can reuse it without having to get it working again.
Actually, all you need there is Else.
No disaster that I'm aware of. But I'm afraid I'm not really following very well.
Anyway, probably the best way to learn this stuff is to try it, and see what happens.
That's ok. It's been a long and draining two days thus far. I think I am up to something though. Else gave me an error by itself on one line, accept if I was ending it right then... - If....then
-
-
.....
-
-
Else
-
-
MsgBox("...")
-
-
End If
-
-
'worked ok, no errors, but...
-
...code to fetch words runs here...after End If
I wanted End If all the way at the end of my if statement so the code runs to find words. End If, before I reopened the file to see what was added, did not allow that part of the code to run. I can't think of the whole code now, will post what I find out, in a bit...
Sounds as though I may have misinterpreted your logic. However, given this code as posted - If Text6.Text = "" Then
-
...
-
ElseIf Text6.Text <> "" Then
-
...
-
End If
I was just pointing out that you'd have got much the same result with - If Text6.Text = "" Then
-
...
- Else
-
...
-
End If
It's really not a big deal.
Sounds as though I may have misinterpreted your logic. However, given this code as posted - If Text6.Text = "" Then
-
...
-
ElseIf Text6.Text <> "" Then
-
...
-
End If
I was just pointing out that you'd have got much the same result with - If Text6.Text = "" Then
-
...
- Else
-
...
-
End If
It's really not a big deal.
Understood...I came up with something, but need professional help to make it work. In order for the application to grab just the word I need, I think I need to talk to VB a little more. We'll start with previously posted example, very helpful, by the way, I have more room to play: -
-
If Lcase(strGetWords$) Like "* dancing *" _
-
Or Lcase(strGetWords$) Like "dancing *" _
-
Or Lcase(strGetWords$) Like "* dancing" _
-
Then
-
…
-
End If
-
I need to tell VB when it finds "rain" to make sure it is giving me the extreme left characters of "rain", threfore train will not get licked up, "t" being the first cahracter here. Here is what I have: -
-
strGetWords$ will attempt to give me "rain" from train, so I am not worried too much. But when it finds train:
-
-
If Left$(strGetWords$, 4) = "rain" And Lcase(strGetWords$) Like " rain *" Then
-
this and that here...
-
End If
-
-
Note above 4 is where I am stuck. I know there is a way to add the character length to Left$ to lock in just "rain". What are your thoughts?
I am still getting, rain from train.
... - strGetWords$ will attempt to give me "rain" from train, so I am not worried too much. But when it finds train:
-
-
If Left$(strGetWords$, 4) = "rain" And Lcase(strGetWords$) Like " rain *" Then
-
this and that here...
-
End If
-
Note above 4 is where I am stuck. I know there is a way to add the character length to Left$ to lock in just "rain". What are your thoughts?
I am still getting, rain from train.
As far as I can see, the sort of check that I suggested for dancing should work. See whether you like any of these variations on the theme... -
' Just to make code shorter, and reduce the number of
-
' function calls, let's convert our text and store in another var.
-
Temp$ = Lcase(strGetWords)
-
-
-
' Version 1 should find any line starting with the 4 letters "rain"...
-
If Temp$ Like "rain*" Then
-
this and that here...
-
End If
-
-
' Version 2 should find only "rain" as the first word...
-
If Temp$ Like "rain *" Then
-
this and that here...
-
End If
-
-
' Version 3 should find any word starting with "rain"...
-
If Temp$ Like "* rain*" Then
-
this and that here...
-
End If
-
-
-
' Version 4 should find the word "rain" anywhere in the string...
-
If Temp$ Like "* rain *" Or Temp$ Like "rain *" Or Temp$ Like "* rain" Then
-
this and that here...
-
End If
-
I may have mentioned this before, but I think it would be a good idea to make a function out of this, so you can just pass the word you're interested in. For example, to implement version 4 in a function... -
Public Function WordExistsIn(ByVal StrSentence as String, ByVal strWord as String) As Boolean
-
If StrSentence Like "* " & strWord & " *" Or _
-
StrSentence Like strWord & " *" Or _
-
StrSentence Like "*" & strWord Then
-
WordExistsIn = True
-
End If
-
End Function
-
As far as I can see, the sort of check that I suggested for dancing should work. See whether you like any of these variations on the theme... -
' Just to make code shorter, and reduce the number of
-
' function calls, let's convert our text and store in another var.
-
Temp$ = Lcase(strGetWords)
-
-
-
' Version 1 should find any line starting with the 4 letters "rain"...
-
If Temp$ Like "rain*" Then
-
this and that here...
-
End If
-
-
' Version 2 should find only "rain" as the first word...
-
If Temp$ Like "rain *" Then
-
this and that here...
-
End If
-
-
' Version 3 should find any word starting with "rain"...
-
If Temp$ Like "* rain*" Then
-
this and that here...
-
End If
-
-
-
' Version 4 should find the word "rain" anywhere in the string...
-
If Temp$ Like "* rain *" Or Temp$ Like "rain *" Or Temp$ Like "* rain" Then
-
this and that here...
-
End If
-
I may have mentioned this before, but I think it would be a good idea to make a function out of this, so you can just pass the word you're interested in. For example, to implement version 4 in a function... -
Public Function WordExistsIn(ByVal StrSentence as String, ByVal strWord as String) As Boolean
-
If StrSentence Like "* " & strWord & " *" Or _
-
StrSentence Like strWord & " *" Or _
-
StrSentence Like "*" & strWord Then
-
WordExistsIn = True
-
End If
-
End Function
-
That's refreshing! Let's give it whirl...
That's refreshing! Let's give it whirl...
Good luck! :)
If you want the function to be more widely applicable, you could set it up to accept options to find the passed word at start of sentence, end of sentence, full word, partial word, or whatever. (Just speculating because I'm interested, here...) You could have an option which accepts values to indicate you want to find a match: - At start of string,
- At end of string,
- At start of a word,
- At end of a word,
- Whole word only, or
- Anywhere in string
Extra credit assignment :)
As an educational exercise, research and set up a public Enum with named values for these options, and a function to use them. (If you haven't played with an Enum before, it's astonishingly simple.)
Good luck! :)
If you want the function to be more widely applicable, you could set it up to accept options to find the passed word at start of sentence, end of sentence, full word, partial word, or whatever. (Just speculating because I'm interested, here...) You could have an option which accepts values to indicate you want to find a match:- At start of string,
- At end of string,
- At start of a word,
- At end of a word,
- Whole word only, or
- Anywhere in string
Extra credit assignment :)
As an educational exercise, research and set up a public Enum with named values for these options, and a function to use them. (If you haven't played with an Enum before, it's astonishingly simple.)
Killer, thanks for posting this, and I will check into 'Start of' & 'End o' string, see where it gets me. I am not familiar with Enum, I checked into it and it seems t be specific to numbers, is this correct?
Going forward, it looks like you did not see my previous note, I copied it and will add to this reply so you can see what I have been up to. Here it goes:
PREVIOUSLY NOTED
HAPPY NEW YEAR VB Fans!!! Hopefully, we continue battling against VB for years to come, unless Microsoft makes this steadily unusable, there's probably big plans when Vista is "Fully" operational, hee, hee...
My friends, Killler, WillAkaWill, VB friends accross the country, I thank you for your support and patience. I think we are almost there. Much appreciated help, by the way, with the code, especially adding the below to the mix. The code works great, but does not seem to be doing what you told me Killer; of course, I am to blame for being a newbie and all. Seems as though, a text file does not abide by rules of certain databases, where VB would be reading from cells containing text/word as opposed to a block of text/words in a .txt file. What do you see happening, I am blind back here. Send me some brain waves, will you?
Should I set a character length I am certain is reachable, whereby one word in the program supports the highest possible character length, 13 characters for lightningbolt...I have been in and out of the code trying diffrent things, my latest brought me to: -
-
temp$Left$(strGetWords$, 13)
-
-
temp$=LCase(StrGetWords$)
-
-
I need a do while loop here, that will check to see if any characters were met, meaning: -
-
Do While temp$ <= 13
-
-
' then have if statements here to grab anything that falls under 13 chars.
-
-
Would you tell me if this is possible? Works by itself and grabs characters already set. Any idea you can provide is helpful. This was an attempt to stay away from looping, I kept getting stuck in a loop: -
-
temp$ = LCase(strGetWords)
-
-
temp$ = Left$(strGetWords, 4)
-
' this should give me rain or anything in that length catagory
-
-
-
temp$ = Left$(strGetWords, 5)
-
' this should give me Train or anything in that length catagory
-
-
-
temp$ = Left$(strGetWords, 6)
-
' this should give me Grains or anything in that length catagory
-
-
-
' Version 1 should find any line starting with the 4 letters "rain"...
-
If temp$ = "rain" Then
-
Text1.Text = "Rain" 'this and that here...
-
End If
-
-
' Version 2 should find only "rain" as the first word...
-
If temp$ = "Train" Then
-
Text2.Text = Text6.Text 'this and that here...
-
End If
-
-
' Version 3 should find any word starting with "rain"...
-
If temp$ Like "Grains" Then
-
Text3.Text = "Grains" 'this and that here...
-
End If
-
-
The only problem here is, the first temp$ variable grabs rain straight away and ignores the other words. I added each word as rain, Train, Grains, and only rain was picked up. My guess is a loop will tell VB to jump over after rain is found in order to find other words from the text box. Any ideas, I know this was a mouth full, Sorry. If the loop is not doable and your previous postings should work please clarify a bit more. :-)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Law.Win |
last post by:
I have an IIF statement in the criteria of a query. I would like to
know how to use a wildcard with the varaibles inside it.
For example IIF(, , )
I would like the wildcard after variable 2.
...
|
by: Torsten |
last post by:
I am attempting to issue an SQL query in C# to and Access database using the
Microsoft.Jet.OLEDB.4.0 provider. The only wildcard character that seems to
work is ‘%’. When using ‘#’,...
|
by: Ken Yee |
last post by:
First a little background: I've written an httphandler to handle wildcard
extensions (i.e., I want to handle all URLs that come in rather than just
URLs w/ a specific file extension so I can give...
|
by: JohnT |
last post by:
Okay... I'm using VB.net (2003) and I am accessing an MS Access DB file.
I have two DataAdapters that I use to search for specific info. The two of
them are similar except one is a Date, the...
|
by: SlimFlem |
last post by:
I have searched hard for 2 days on this and keep hitting a wall. I
have a custom IHttpHandler setup to do Url mappings to prop up some old
Urls for our site. I have also created a wildcard...
|
by: hawkesed |
last post by:
If I have a list, say of names. And I want to count all the people
named, say, Susie, but I don't care exactly how they spell it (ie,
Susy, Susi, Susie all work.) how would I do this? Set up a...
|
by: googlegroups.dsbl |
last post by:
I'm really confused here, and am wondering if someone knows what could
be the issue with my TableAdapter query.
A few months ago, I created a really neat program that has th ability
to search by...
|
by: google |
last post by:
I need a simple wildcard pattern matching function written in JS. I
have wrestled with regular expresions but frankly am struggling to come
up with anything less than an epic function of many lines...
|
by: Dave |
last post by:
I need to filter an Access 2000 result set in ASP 30 using the ADO
recordset.filter.
I build the filter in pieces. The first clause of the filter is this...
WHERE word LIKE 'S%'
... to...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |