-------------------------------------
我靠,都弄出阶级愁民族狠啦。        |
瞄了一眼你写的这段代码。            |
如果你是女的,还是劝你承认了吧|
-------------------------------------
you are right

解决方案 »

  1.   

    我想这不是你写的代码吧。很多过程或函数没有给出来。不过我觉得应该在
    ret = wrap_write(comm, bufw(), length_write, SAVE_COMMAND) 后面加上
    redim bufw(len("欢迎使用"))
    bufw(0)="欢"
    bufw(1)="迎"
    bufw(2)="使"
    bufw(3)="用"ret = wrap_write(comm, bufw(), length_write(试不是 bufw()长度), SAVE_COMMAND) 我没有仔细看
    不知道对不对
      

  2.   

    我想这不是你写的代码吧。很多过程或函数没有给出来。不过我觉得应该在
    ret = wrap_write(comm, bufw(), length_write, SAVE_COMMAND) 后面加上
    redim bufw(len("欢迎使用"))
    bufw(0)="欢"
    bufw(1)="迎"
    bufw(2)="使"
    bufw(3)="用"ret = wrap_write(comm, bufw(), length_write(试不是 bufw()长度), SAVE_COMMAND) 我也没有仔细看
    不知道对不对……?
      

  3.   

    wrap_write ?
    set_room_guard ?
    delay_msec ?
    实现的目的是什么?
      

  4.   

    xiaoran2000 (潇然) :
      看了上面的程序,本来我也想感慨感慨。
      不过看了有那么多兄弟都说过了,我就不再说那些了。
      从程序看,也许你编程序时间不长,没有什么经验和变成技巧,但你有足够的耐心与细心,这还是不错的。
      谁都有龌龊的过去,但不要有龌龊的未来。
      

  5.   

    很久没写VB程序了,今天一时兴起从头看了一遍,没太看明白。
    不过写程序思路很重要,程序结构也很重要。
    时间不多,要回去了。写了一些贴出来,下次再接着写
    '打开表
    'Rs 返回的记录集
    'Conn 数据连接
    'strSQL 查询语句
    Public Function OpenTable(ByRef Rs As Adodb.Recordset, ByVal Conn As Adodb.Connection, ByVal strSQL As String) As BooleanEnd Function '读出用户代号
     'Rs 用户数据集
     ' strID 代号
    Public Function ReadCusID(ByVal Rs As Adodb.Recordset, ByVal strID As String)End Function
    '读出用户数据
    'ngWaterValue 电表度数
    'sngElecValue 水表度数
    'sngGasValue 煤气表度数
    'curWaterExpanse 水表金额
    'curElecExpanse 电表金额
    'curGasExpanse 煤气表金额
    'curManager 物业管理费
    'curAll 费用总计
    Public Function ReadCusData(ByVal ngWaterValue As Single, _
                                 ByVal sngElecValue As Single, _
                                 ByVal sngGasValue As Single, _
                                 ByVal curWaterExpanse As Currency, _
                                 ByVal curElecExpanse As Currency, _
                                 ByVal curGasExpanse As Currency, _
                                 ByVal curManager As Currency, _
                                 ByVal curAll As Currency) As Boolean
                                 
                                 
                                 
    End Function'水表数据
    Public Function WaterValue(ByRef sngValue As Single, _
                                ByRef strValue As Single, _
                                ByRef strLeft As Single, _
                                ByRef strRight As Single, _
                                ByRef bufw() As String, _
                                ByVal i As Integer) As Boolean
                                
    End Function
      

  6.   

    Dim byteAry() As Byte
    Dim str5 As String
    Dim i As Long
    str5 = "欢迎使用"
    byteAry = StrConv(str5, vbFromUnicode)
    length_write=UBound(byteAry)
    ret = wrap_write(comm, byteAry() ,length_write, SAVE_COMMAND) 
    小女生试一下看行不行??
      

  7.   

    注意,小姐
    函数需要返回值我对这个程序的理解是入口:userid
    结果:用户的各种消费额和花费      Dim sngWaterValue As Single     '水表度数
        Dim sngElecValue As Single
        Dim sngGasValue As Single
        Dim curWaterExpanse As Currency '水表金额
        Dim curElecExpanse As Currency
        Dim curGasExpanse As Currency
        Dim curManager As Currency '管理费
        Dim curAll As Currency    '费用总计    等变量都应该可以被显示,而最好提供一选择可以在提供一各参数,根据不同的参数显示不同程度的数据
    比如 0 代表 显示 Dim curAll As Currency    '费用总计
         1 代表 显示 Dim curWaterExpanse As Currency '水表金额
                 Dim curElecExpanse As Currency
                 Dim curGasExpanse As Currency
                 Dim curManager As Currency '管理费
                 Dim curAll As Currency    '费用总计      
          2代表 显示 全部这可以用select语句实现,添在最后就行至于欢迎使用在最后面直接添一条语句就行了,最简单用msgbox
                                  效果好点就用一个flashform显示一下想给你提个醒1、程序注释太少
    2、代码冗余太多
    3、这个程序就是长,算法很简单,没必要写个吓人的题目我的email [email protected]
      

  8.   

    帮你一点吧,后面的代码没看.前面的有点问题:    rsPerson.Open "用户明细表", conn, , , adCmdTable
        Dim szGuardType As String
        flag = -1
        rsPerson.MoveFirst
        Do While Not rsPerson.EOF
            If rsPerson.Fields("用户代号") = UserID Then
                flag = 1
                Exit Do
            End If
            rsPerson.MoveNext
        Loop
    '------------------------不必要这样.
    rsPerson.open "select * from 用户明细表 where 用户代号='" & UserID & "'"", conn, , , adCmdTable
    if rsPerson.EOF or rsPerson.BOF then
    flag = 1
    end if
    '-----------------------象你做的每次都全部检测所有的太慢了....