Skolski primer srpsko-engleskog recnika.
'Autor: Rajko Kuzmanovic 07.08.2009 rgdrajko@verat.net
'frmRecnik
Private Sub cmdPrevedi_Click()
Dim Jezik As String
Dim Fraza As String
Dim Prevod As String
Dim prviseparator As Integer
frmRecnik.txtSacekajte.Visible = True
frmRecnik.txtSacekajte.Refresh
For n = 1 To UBound(baza())
If Len(baza(n)) > 0 Then
prviseparator = InStr(baza(n), "|")
Jezik = Mid(baza(n), 1, prviseparator - 1)
drugiseparator = InStr(prviseparator + 1, baza(n), "|")
Fraza = Mid(baza(n), prviseparator + 1, drugiseparator - prviseparator - 1)
Prevod = Mid(baza(n), drugiseparator + 1)
If Trim(UCase(txtFraza.Text)) = Trim(UCase(Fraza)) Or Trim(UCase(txtFraza.Text)) = Trim(UCase(Prevod)) Then
frmRecnik.txtSacekajte.Visible = False
lstPrevod.AddItem Jezik & " | " & Fraza & " | " & Prevod
Exit Sub
End If
End If
Next n
frmRecnik.txtSacekajte.Visible = False
lstPrevod.AddItem "Ne postoji ta rec"
End Sub
Private Sub txtFraza_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Or KeyAscii = 32 Then
txtFraza.Text = ""
lstPrevod.Clear
End If
End Sub
'Autor: Rajko Kuzmanovic 07.08.2009 rgdrajko@verat.net
'basMain
Option Explicit
Public PutanjaImeTxtBazeEkstenzija As String
Public baza()
Public Sub Main()
frmRecnik.Show
frmRecnik.txtSacekajte.Visible = True
frmRecnik.txtSacekajte.Refresh
Call UcitavanjeBazeUMemorju
frmRecnik.txtSacekajte.Visible = False
End Sub
Public Sub UcitavanjeBazeUMemorju()
Dim brojac As Long
Dim ocitanoizfajla As String
ReDim baza(10)
PutanjaImeTxtBazeEkstenzija = App.Path & "\Reci.txt"
Open PutanjaImeTxtBazeEkstenzija For Input As #1
brojac = 0
Do While Not EOF(1)
Line Input #1, ocitanoizfajla
If brojac > 0 Then
baza(brojac) = ocitanoizfajla
End If
brojac = brojac + 1
If brojac Mod 10 = 0 Then
ReDim Preserve baza(brojac + 10)
End If
DoEvents
Loop
Close #1
End Sub
https://www.mycity.rs/must-login.png
|