在C语言里,'a'+1就是'b'
在VB里面,通过什么操作可以把'a' 转化为'b',让字符的ASCII码加1?

解决方案 »

  1.   

     是这样,不过vb不支持象c那样可以随意的类型转换,所以要麻烦点dim x as string 
    x = cstr(asc("a") + 1)可能还有更简单的
      

  2.   

     
    x = cstr(asc("a") + 1) 是错的,看来得更麻烦点了,copymemory 实现的dim x as string 
    x="a"
    copymemory byval strptr(x),asc(x) + 1,1
    msgbox x
      

  3.   

     晕,是chr,忘了,给想成 cstr 去了
      

  4.   

    字节数组也可以
    Sub test()
        Dim bt() As Byte
        bt = "a"
        bt(0) = bt(0) + 1
        MsgBox bt
    End Sub
      

  5.   

    x="a"
    x=chr(asc(x)+1)
    刚才发错了,少了点东西
      

  6.   

    Private Sub Command1_Click()
        Dim str As String
        str = "a"
        str = Chr(Asc(str) + 1)
        MsgBox str
    End Sub