您的位置:程序门 -> vb -> 基础类



问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


问题
发表于:2007-11-04 10:51:03 楼主
问题

private   sub   form_click()
dim   h   as   long
dim   s     as   string
dim   j   as   integer,   i   as   integer
j   =   len(text1.text)
i   =   1

do   while   i   <=   j

      h   =   abs(asc(mid(text1.text,   j,   1)))
                      do   while   h   >   0
                                    s   =   str(h   mod   2)   +   trim(s)
                                    h   =   h   \   2
                                    doevents
         
                        loop
                                    text2.text   =   s
                                    print
                                    j   =   j   -   1
                                 
loop

end   sub
请帮我修改这些代码,我想把文字转为数字,但我希望我输入文字后,在另外一个文本筐输出的数字,输出一个字的asc码(二进制的)就空一个空格,而我的代码是连续输出的,
 
 
发表于:2008-01-11 14:23:411楼 得分:0
private   sub   form_click()
        dim   h           as   long
        dim   s               as   string
        dim   j           as   integer,   i               as   integer
        j   =   len(text1.text)
        i   =   1
       
        do   while   i   <=   j
       
                h   =   abs(asc(mid(text1.text,   j,   1)))
                do   while   h   >   0
                        s   =   (h   mod   2)   &   s
                        h   =   h   \   2
                        doevents
       
                loop
                s   =   "   "   &   s
                text2.text   =   s
                print
                j   =   j   -   1
        loop
end   sub


快速检索

热门点击