- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
Sub display(frm As Form)
Dim lvl As Boolean
Dim format As String
If (frm.optSex(0).value) Then
format = oI18n.translate("res_m")
format = Replace(format, "\n", vbCrLf, 1, -1, vbBinaryCompare)
format = Replace(format, "*", frm.cmbSchool.Text, 1, 1, vbTextCompare)
format = Replace(format, "*", frm.txtForm.Text, 1, 1, vbTextCompare)
format = Replace(format, "*", frm.txtName.Text, 1, 1, vbTextCompare)
format = Replace(format, "*", frm.txtSurname.Text, 1, 1, vbTextCompare)
lvl = False
For Each optLvl In frm.chkLevel
If (optLvl.value) Then
format = Replace(format, "*", oI18n.translate(optLvl.Tag & "_m"), 1, 1, vbTextCompare)
lvl = True
End If
Next optLvl
If (Not lvl) Then format = Replace(format, "*", oI18n.translate("Bad" & "_m"), 1, 1, vbTextCompare)
End If
If (frm.optSex(1).value) Then
format = oI18n.translate("res_f")
format = Replace(format, "\n", vbCrLf, 1, -1, vbBinaryCompare)
format = Replace(format, "*", frm.cmbSchool.Text, 1, 1, vbTextCompare)
format = Replace(format, "*", frm.txtForm.Text, 1, 1, vbTextCompare)
format = Replace(format, "*", frm.txtName.Text, 1, 1, vbTextCompare)
format = Replace(format, "*", frm.txtSurname.Text, 1, 1, vbTextCompare)
lvl = False
For Each optLvl In frm.chkLevel
If (optLvl.value) Then
format = Replace(format, "*", oI18n.translate(optLvl.Tag & "_f"), 1, 1, vbTextCompare)
End If
Next optLvl
If (Not lvl) Then format = Replace(format, "*", oI18n.translate("Bad" & "_f"), 1, 1, vbTextCompare)
End If
Dim dalykai As String
Dim first As Boolean
dalykai = ""
first = True
For Each chkFavorite In frm.chkFavorites
If (chkFavorite.value) Then dalykai = dalykai & IIf(first, vbCrLf, vbCrLf) & (chkFavorite.Caption)
first = False
Next chkFavorite
If (frm.chkFavoriteOther.value) Then dalykai = dalykai & IIf(first, vbCrLf, vbCrLf) & (frm.txtFavoriteOther.Text)
Dim b As Boolean
b = dalykai = ""
If (b) Then
If (frm.optSex(0).value) Then dalykai = oI18n.translate("nores_m")
If (frm.optSex(1).value) Then dalykai = oI18n.translate("nores_f")
End If
If (Not b) Then
If (frm.optSex(0).value) Then dalykai = oI18n.translate("res2_m") & dalykai
If (frm.optSex(1).value) Then dalykai = oI18n.translate("res2_f") & dalykai
End If
MsgBox (format & vbCrLf & dalykai)
End Sub
Dummy00001 10.01.2011 23:54 # 0
зачем? массивы то в VB есть: зафигачиваешь функцию для распила строки в массив по разграничителю + функцию для склеивания строки из массива, а все остальное становится относительно простым.
Lure Of Chaos 10.01.2011 23:59 # 0
SemaReal 13.10.2017 22:56 # 0
vistefan 14.10.2017 12:07 # +3
bormand 14.10.2017 13:24 # +2
Lure Of Chaos 14.10.2017 16:48 # +4
vistefan 14.10.2017 17:16 # +4
inkanus-gray 15.10.2017 06:20 # +1
inho 14.10.2017 16:07 # 0