WWW.. cpp.sources.ru
java.sources.ru web.sources.ru soft.sources.ru
jdbc.sources.ru asp.sources.ru api.sources.ru

  
  Visual Basic
  richtextbox

  
| | faq

:   richtextbox
aker13 24-01-2002 15:17 MSK   Click Here to See the Profile for aker13   Click Here to Email aker13  
kak pomenyat kodirovku (programno) richtextbox-a
AlexR 24-01-2002 16:24 MSK     Click Here to See the Profile for AlexR  Click Here to Email AlexR     
?
cr 24-01-2002 16:31 MSK     Click Here to See the Profile for cr  Click Here to Email cr     
Option Explicit

Enum Code
Win = 1
Dos = 2
Koi = 3
Iso = 5
End Enum
Function Recode(Char As String, Src As Code, Dest As Code) As String
Const wDos As String = ""
Const wIso As String = "ע"
Const wKoi As String = ""
Const wWin As String = ""
Const NotRecodedChar As String = "?"

If Src = Dest Then
Recode = Char
Exit Function
End If

Dim t As String, i As Long, tt As String, a As Long, ss As String, ch As String
If Src = Win Then
t = Char
Else
Select Case Src
Case Koi: ss = wKoi
Case Dos: ss = wDos
Case Iso: ss = wIso
End Select
For i = 1 To Len(Char)
ch = Mid(Char, i, 1)
If Asc(ch) < 128 Then
t = t & ch
Else
a = InStr(1, ss, ch, vbBinaryCompare)
If a = 0 Then
t = t & NotRecodedChar
Else
t = t & Mid$(wWin, a, 1)
End If
End If
Next i
End If

If Dest = Win Then
Recode = t
Else
Select Case Dest
Case Koi: ss = wKoi
Case Dos: ss = wDos
Case Iso: ss = wIso
End Select
For i = 1 To Len(Char)
ch = Mid(t, i, 1)
If Asc(ch) < 128 Then
tt = tt & ch
Else
a = InStr(1, wWin, ch, vbBinaryCompare)
If a = 0 Then
tt = tt & NotRecodedChar
Else
tt = tt & Mid$(ss, a, 1)
End If
End If
Next i
Recode = tt
End If
End Function

aker13 25-01-2002 09:00 MSK     Click Here to See the Profile for aker13  Click Here to Email aker13     
vse otlichno, tolko nemnogo poyasni? chto mne nujno sdelat? v dvux slovax

spas!!!

cr 25-01-2002 09:58 MSK     Click Here to See the Profile for cr  Click Here to Email cr     
Option Explicit
'To aker13
'
'
' win, koi, dos, iso .
' : Recode (,___, _-
', _)
': Recode (text1.text, win, dos)
'- (text1) win dos
'
' :
' : text1, text2, command1
' text1 text2 :
'Text1.MultiLine = True
'Text2.MultiLine = True
'Text1.ScrollBars = 2
'Text2.ScrollBars = 2
' .
'
' ,
'(text1) win koi.
' text2
'
Enum Code1
win = 1
Dos = 2
koi = 3
Iso = 5
End Enum
Function Recode(Char As String, Src As Code1, Dest As Code1) As String
Const wDos As String = ""
Const wIso As String = "ע"
Const wKoi As String = ""
Const wWin As String = ""
Const NotRecodedChar As String = "?"
If Src = Dest Then
Recode = Char
Exit Function
End If
Dim t As String, I As Long, tt As String, a As Long, ss As String, ch As String
If Src = win Then
t = Char
Else
Select Case Src
Case koi: ss = wKoi
Case Dos: ss = wDos
Case Iso: ss = wIso
End Select
For I = 1 To Len(Char)
ch = Mid(Char, I, 1)
If Asc(ch) < 128 Then
t = t & ch
Else
a = InStr(1, ss, ch, vbBinaryCompare)
If a = 0 Then
t = t & NotRecodedChar
Else
t = t & Mid$(wWin, a, 1)
End If
End If
Next I
End If
If Dest = win Then
Recode = t
Else
Select Case Dest
Case koi: ss = wKoi
Case Dos: ss = wDos
Case Iso: ss = wIso
End Select
For I = 1 To Len(Char)
ch = Mid(t, I, 1)
If Asc(ch) < 128 Then
tt = tt & ch
Else
a = InStr(1, wWin, ch, vbBinaryCompare)
If a = 0 Then
tt = tt & NotRecodedChar
Else
tt = tt & Mid$(ss, a, 1)
End If
End If
Next I
Recode = tt
End If
End Function
Private Sub Command1_Click()
Screen.MousePointer = 11
Text2.Text = (Recode(Text1.Text, koi, win))
Screen.MousePointer = 0
End Sub
Private Sub Form_Load()
Text1.Text = " , koi8-r, . Recode!"
Text2.Text = ""
Command1.Caption = "Recode"
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim counter As Integer
Dim I As Integer
counter = Me.Height
Do: DoEvents
counter = counter - 10
Me.Height = counter
Me.Top = (Screen.Height - Me.Height) / 2
Loop Until counter <= 10
I = 15
counter = Me.Width
Do: DoEvents
counter = counter + I
Me.Width = counter
Me.Left = (Screen.Width - Me.Width) / 2
I = I + 1
Loop Until counter >= Screen.Width
End
End Sub
aker13 25-01-2002 10:05 MSK     Click Here to See the Profile for aker13  Click Here to Email aker13     
rabotayet, kak nikogda! very very sankse!!!
aker13 25-01-2002 10:30 MSK     Click Here to See the Profile for aker13  Click Here to Email aker13     
a kak, voobshe uznat kodirovku texta?

  
:


E-mail | WWW..RU

Powered by: Ultimate Bulletin Board, Freeware Version 5.10a
Purchase our Licensed Version- which adds many more features!
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.