- Hadzaf (pembuangan huruf)
- Naql (pemindahanhuruf/syakal)
- Ibdal (penggantian huruf)
- Ziyadah (penambahan huruf)
Berikut ini dua fungsi yang telah dibuat untuk keperluan di atas:
Option Explicit
'//--------------------------------------------------------------------
'// Dua fungsi utama software tashrif
'//--------------------------------------------------------------------
'Fungsi pertama: untuk menyamakan syakal
Function SamakanSyakal(sMauzun As String, sWazan As String) As String
Dim s() As String
Dim c() As String
Dim i As Integer
Dim a As Integer
Dim d As String
Dim g As String
ReDim s(Len(sWazan))
ReDim c(Len(sWazan))
a = 1
For i = 1 To Len(sWazan)
s(i) = Mid(sWazan, i, 1)
Next
For i = 1 To UBound(c)
d = Mid(sWazan, i, 1)
If d = "ظژ" Or _
d = "ظڈ" Or _
d = "ظگ" Or _
d = "ظ’" Or _
d = "ظŒ" Or _
d = "ظ‹" Then
c(i) = d
Else
c(i) = Mid(sMauzun, a, 1)
a = a + 1
End If
Next
For i = 1 To UBound(c)
g = g & c(i)
Next
SamakanSyakal = g
End Function
'//--------------------------------------------------------------------
'//Fungsi kedua: untuk menyamakan huruf
'//--------------------------------------------------------------------
Function SamakanHuruf(sMauzun As String, PolaWazan As String) As String
Dim s() As String
ReDim s(Len(PolaWazan))
Dim i As Integer
Dim c As String
For i = 1 To Len(PolaWazan)
If Mid(PolaWazan, i, 1) < 9 Then
c = c & Mid(sMauzun, Mid(PolaWazan, i, 1), 1)
Else
c = c & Mid(PolaWazan, i, 1)
End If
Next
SamakanHuruf = c
End Function
Di bawah ini sedikit contoh untuk wazan ط§ط³طھظپط¹ظ„ yang salim.
'----------------------------------------------------------------------------
'//Contoh penggunaan dua fungsi di atas
'----------------------------------------------------------------------------
Private Sub cmdGenerate_Click()
Dim d As String
Dim c As String
c = Text2.Text
'Madhi ط§ظ„ظ…ط§ط¶ظٹ
d = SamakanSyakal(SamakanHuruf(c, "123456"), "ط¥ظگط³ظ’طھظژظپظ’ط¹ظژظ„ظژ")
'Mudhore ط§ظ„ظ…ط¶ط§ط±ط¹
d = d & " - " & SamakanSyakal(SamakanHuruf(c, "ظٹ23456"), "ظٹظژط³ظ’طھظژظپظ’ط¹ظگظ„ظڈ")
'Mashdar ط§ظ„ظ…طµط¯ط±
d = d & " - " & SamakanSyakal(SamakanHuruf(c, "ط¥2345ط§6ط§"), "ط¥ظگط³ظ’طھظگظپظ’ط¹ظژط§ظ„ط§ظ‹")
'Fa'il ط§ظ„ظپط§ط¹ظ„
d = d & " - ظپظ‡ظˆ " & SamakanSyakal(SamakanHuruf(c, "ظ…23456"), "ظ…ظڈط³ظ’طھظژظپظ’ط¹ظگظ„ظŒ")
'Maf'ul ط§ظ„ظ…ظپط¹ظˆظ„
d = d & " - ظˆط°ط§ظƒ " & SamakanSyakal(SamakanHuruf(c, "ظ…23456"), "ظ…ظڈط³ظ’طھظژظپظ’ط¹ظژظ„ظŒ")
'Amr ط§ظ„ط£ظ…ط±
d = d & " - " & SamakanSyakal(SamakanHuruf(c, "ط¥23456"), "ط¥ظگط³ظ’طھظژظپظ’ط¹ظگظ„ظ’")
'Nahi ط§ظ„ظ†ظ‡ظٹ
d = d & " - ظ„ط§ " & SamakanSyakal(SamakanHuruf(c, "طھ23456"), "طھظژط³ظ’طھظژظپظ’ط¹ظگظ„ظ’")
'Makan ط§ظ„ظ…ظƒط§ظ†
d = d & " - " & SamakanSyakal(SamakanHuruf(c, "ظ…23456"), "ظ…ظڈط³ظ’طھظژظپظ’ط¹ظژظ„ظŒ")
'Zaman ط§ظ„ط²ظ…ط§ظ†
d = d & " - " & SamakanSyakal(SamakanHuruf(c, "ظ…23456"), "ظ…ظڈط³ظ’طھظژظپظ’ط¹ظژظ„ظŒ")
Text3.Text = d
End Sub