⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 udtconv.bas

📁 Pocket PC 2002发送短信的程序
💻 BAS
字号:
Attribute VB_Name = "basUDTConv"
'******************************************************************************
' Implements UDT value conversion functions
'******************************************************************************
' FileName:  basUDTConv.bas
' Creator:   Christian Forsberg
' Created:   2002-06-06
'******************************************************************************
' Version   Date   Who Comment
' 00.00.000 020606 CFO Created
'******************************************************************************
Option Explicit
Function LongToBytes(ByVal Value As Long) As String
  
' Convert long value to string of bytes.
' IN:  Value, long value
' OUT: LongToBytes, string with long value converted to bytes
' Known bugs:
' Version   Date   Who Comment
' 00.00.000 020606 CFO Created
'******************************************************************************
  Dim lsHex As String, i As Integer
  
  lsHex = Right("00000000" & Hex(Value), 8)
  For i = 1 To 7 Step 2
    LongToBytes = ChrB(CInt("&H" & Mid(lsHex, i, 2))) & LongToBytes
  Next

End Function
Function BytesToLong(ByVal Value As String) As Long
  
' Convert string of bytes to long value.
' IN:  Value, string
' OUT: BytesToLong, long value converted from string of bytes
' Known bugs:
' Version   Date   Who Comment
' 00.00.000 020606 CFO Created
'******************************************************************************
  Dim lsHex As String, i As Integer
  
  For i = 1 To 4
    lsHex = Hex(AscB(MidB(Value, i, 1))) & lsHex
  Next
  BytesToLong = CLng("&H" & lsHex)

End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -