dim kitty, a1,a2 as integer
dim new1 as string
kitty = 123454321
new1 = ""
a2 = kitty
for i = 1 to 9
a1 = a2 mod 10
new1 = new1 & a1
a2 = a2 \ 10
if a2 = 0 then exit for
NEXT
if new1 = kitty THEN
textbox1.text = kitty & "是迴文"
Else
textbox1.text = kitty & "不是迴文"
end if
'*************************
kitty = 12321 'KITTY 的初始值
new1 = "" 'NEW1 = 空值
a1 = kitty
For i = 1 To 9 '迴文 變數 重複九次 '九次以內會完結'
a2 = a1 Mod 10 'A2取最後一個值 取餘數
new1 = new1 & a2 '最後一個值 存入NEW1
a1 = a1 \ 10 '整除最後一個值 變1232
If a1 = 0 Then Exit For '當A1 = 0 跳出洄圈
Next
If new1 = kitty Then '取出來的值=初始值
TextBox1.Text = new1 & "YES" '在textbox1.text 宣示 是迴文
Else
TextBox1.Text = new1 & "NO" '在textbox1.text 宣示 不是迴文
End If