Dim a(1 To 100) As Integer '存储压缩数据,最大处理个数为100
Dim b(1 To 1000) As Integer '存储解压缩数据,最大处理个数为1000
Dim n As Integer '存储压缩数据的个数
Private Sub Form_Load()
'压缩数据由上述压缩方法生成
'本过程用于读取压缩数据并存储在数组a,压缩数据个数存储在变量n中
'代码略
End Sub
Private Sub Command1_Click()
Dim pa As Integer '存储压缩数组当前处理位置
Dim pb As Integer '存储解压缩数组当前处理位置
Dim firstdata As Integer, count As Integer, i As Integer
pa = 1: pb = 1
Do While pa <= n
firstdata = a(pa)
If firstdata <> 0 Then '示例1情况处理
b(pb) = firstdata
pa = pa + 1: pb = pb + 1
Else
count = a(pa + 1)
If count = 0 Then '示例2情况处理
b(pb) = 0
pa =____________: pb = pb + 1
Else '示例3情况处理
For i = 1 To count
_____________
Next i
pa = pa + 3: pb = pb + count
End If
End If
Loop
Text2.Text = Str(b(1))
For i = 2 To _________
Text2.Text = Text2.Text + "," + Str(b(i))
Next i
哈士奇WWW