دستور Search در ويژوال بيسيك6

777

New Member
سلام
من يك برنامه جستجو با ويژوال بيسيك6 نياز دارم.دوستاني كه به اين موضوع احاطه دارند لطفاْ مرا راهنمايي نمايند.سپاسگذارم.
 

ImanYari

Member
سلام
لطف كنيد بگيد چه جور جستجويي ميخواين؟
يعني توي چي ميخواين بگردين!

ايمان
 

masoud_kia_kia

New Member
جستجوي عدد

راستش من جستجوي متن كدشو مينيويسم
کد:
Private Sub cmdSearch_Click()
Dim txt1 As String, txt2 As String
Dim firstS As Integer, lastS As Integer

txt1 = txtinput1.Text
txt2 = txtinput2.Text

firstS = InStr(txt1, txt2)
If firstS <> 0 Then
lbldisplay1.Caption = " Forward Search The text was found ast position " & firstS
Else
lbldisplay1.Caption = " Forward Search The text was Not found"
End If

lastS = InStrRev(txt1, txt2)
If lastS <> 0 Then
lbldisplay2.Caption = " Backward Search The text was found ast position " & lastS
Else
lbldisplay2.Caption = " Backward Search The text was Not found"
End If

End Sub

اگر مفهوم نبود به من ميل بزن
[email protected]
براي عدد كه جستجوي خطي است
کد:
Function linearsearch(a() As Integer, key As Integer) As Integer
Dim x As Integer
 For x = LBound(a) To UBound(a)
 If a(x) = key Then
 linearsearch = x
 Exit Function
 End If
Next x
linearsearch = -1
 
End Function
 

Reza007

Member
اين يك برنامه find&replace است كه براي شما ساخته ام.اميدوارم به دردتان بخورد
:oops: :!:
 

جدیدترین ارسال ها

بالا