Microsoft Small Basic

Program Listing: HMH849
SourceText = "This is a test"

Checkfor = "Test"
TestFor()

Checkfor = "test"
TestFor()

Sub TestFor
FoundBeginingAt = Text.GetIndexOf(SourceText,Checkfor)
TextWindow.WriteLine("Position begining at = " + FoundBeginingAt)
If FoundBeginingAt <> 0 Then
TextWindow.WriteLine("Yes, it contains the word " + Checkfor)
Else
TextWindow.WriteLine("No, it does NOT contain the word " + Checkfor)
EndIf
EndSub