我没调试我程序而已
楼上的 别问应该你自己解决的问题
'偷懒下,因为不超过30个字符……懒得冒泡排序了,放个list1控件设置Sort属性为True。
Option Explicit
Option Base 1
Private Sub Command1_Click()
Dim a() As String, InputStr As String, StrLen As String
InputStr = Text1
StrLen = Len(InputStr)
ReDim a(StrLen)
Dim i As Integer
For i = 1 To StrLen
a(i) = Mid$(InputStr, i, 1)
If Asc(a(i)) > 96 And Asc(a(i)) < 123 Then
List1.AddItem a(i)
a(i) = ""
End If
Next
Dim k As Integer
Dim OutStr As String
For i = 1 To StrLen
If a(i) = "" Then
OutStr = OutStr & List1.List(k)
k = k + 1
Else
OutStr = OutStr & a(i)
End If
Next
Text2 = OutStr
List1.Clear
End Sub
'偷懒下,因为不超过30个字符……懒得冒泡排序了,放个list1控件设置Sort属性为True。
Option Explicit
Option Base 1
Private Sub Command1_Click()
Dim a() As String, InputStr As String, StrLen As String
InputStr = Text1
StrLen = Len(InputStr)
ReDim a(StrLen)
Dim i As Integer
For i = 1 To StrLen
a(i) = Mid$(InputStr, i, 1)
If Asc(a(i)) > 96 And Asc(a(i)) < 123 Then
List1.AddItem a(i)
a(i) = ""
End If
Next
Dim k As Integer
Dim OutStr As String
For i = 1 To StrLen
If a(i) = "" Then
OutStr = OutStr & List1.List(k)
k = k + 1
Else
OutStr = OutStr & a(i)
End If
Next
Text2 = OutStr
List1.Clear
End Sub
用LIST 这思路不错……可以无法移植到pascal里面