• Welcome to Valhalla Legends Archive.
 

Help....

Started by OuTLawZGoSu, December 18, 2003, 01:33 PM

Previous topic - Next topic

OuTLawZGoSu

How can i make it so, when you press a button, it opens a text file(txt), searches for specific text, then matches it with everything in text1. if it all matches, show a msgbox.

thx.

effect

Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

Grok

Quote from: OuTLawZGoSu on December 18, 2003, 01:33 PM
How can i make it so, when you press a button, it opens a text file(txt), searches for specific text, then matches it with everything in text1. if it all matches, show a msgbox.

thx.

Easy.

1.  Make a button.
2.  Add code to the button to open a text file and read the contents.
3.  While reading the contents, search for the specific text.
4.  I dont understand the "matches it with everything in text1" part.
5.  If it all matches, show a msgbox.

Hope this helps.

effect

Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

OuTLawZGoSu

Quote from: Grok on December 18, 2003, 05:27 PM
Easy.

1.  Make a button.
2.  Add code to the button to open a text file and read the contents.
3.  While reading the contents, search for the specific text.
4.  I dont understand the "matches it with everything in text1" part.
5.  If it all matches, show a msgbox.

Hope this helps.

I got everything exept for the search for the text code. I dont know how to search for the text in the text file.
And number 4, i meant,  "If text1.text = Searched text Then"


effect

i suggest looking into the LIKE operator?
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

Grok

Quote from: OuTLawZGoSu on December 18, 2003, 06:26 PM
Quote from: Grok on December 18, 2003, 05:27 PM
Easy.

1.  Make a button.
2.  Add code to the button to open a text file and read the contents.
3.  While reading the contents, search for the specific text.
4.  I dont understand the "matches it with everything in text1" part.
5.  If it all matches, show a msgbox.

Hope this helps.

I got everything exept for the search for the text code. I dont know how to search for the text in the text file.
And number 4, i meant,  "If text1.text = Searched text Then"



InStr
InStrRev
StrComp
Like

Those are sufficient for most tasks.

effect

#7
Sorry refer to my post below , bashed the keyboard and accidently posted and didnt realise =/ My bad
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

effect

#8
Against better judgement im gonna post this up , maybe u can find a better example somewhere else


Dim Scompare as Long
Dim String1 as String
Dim String2 as String

Scompare  = InStr(String1, String2, vbTextCompare)
    IF Scompare = > 0 Then
        dowhateverupleaserighthere
    End if


there u go knock yourself out
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.