Okay,
I wanna make a translator that finds words and changes them individually.
So it should,
1. Find a certain word
2. Change that word
3. Repeat step 1 until words are done
Printable View
Okay,
I wanna make a translator that finds words and changes them individually.
So it should,
1. Find a certain word
2. Change that word
3. Repeat step 1 until words are done
You could use the Replace function to search for a word something like this
VB Code:
Option Explicit Private Sub Command1_Click() Dim changeWords(1, 1) As String changeWords(0, 0) = "Hello" changeWords(0, 1) = "Goodbye" changeWords(1, 0) = "Sorry" changeWords(1, 1) = "Not Sorry" Text2.Text = Replace(Text1.Text, changeWords(0, 0), changeWords(0, 1)) End Sub
so exactly how does that work?
Blinky created a two-column array that looks like
"Hello" "Goodbye"
"Sorry" "Not Sorry"
He/she then uses VB6's built in Replace function to change "Hello" to "Goodbye" or "Sorry" to "Not Sorry".
ohhhhhhhh thanks!!!
If you use VB5 you wont be able to use the Replace function :(
so that actually did add something to vb 6
anyways is it case-sensitive and if so how do i make it non case-sensitive?
Use vbTextCompare as the past parameter in the replace function.