TAILIEUCHUNG - Programming Microsoft SQL Server 2000 with Microsoft Visual Basic .Net - P6

Tham khảo tài liệu 'programming microsoft sql server 2000 with microsoft visual basic .net - p6', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | End Sub Going from a hexadecimal value to a Long value is more complicated for a couple of reasons. First there is no built-in function. Second hexadecimal numbers need to be converted on a character-by-character basis that reflects the character s position in the hexadecimal number. This task is further complicated by that fact that characters go outside the decimal range of 0 through 9 to the hexadecimal range of 0 through F. The following sample performs a check to verify that the hexadecimal string value doesn t exceed the maximum Long value. The hex representation for the maximum Long value is 7FFFFFFFFFFFFFFF. After performing a bound check for the maximum hexadecimal value the ConvertHexToLng procedure starts a loop that iterates through successive characters in the hexadecimal number. Starting at the far right character the loop evaluates each character. The evaluation multiplies the hex character s decimal value by a power of 16. The powers range in value from 0 for the far right character to up to 15 for the sixteenth hex character if there is one . When the ConvertHexToLng procedure finishes looping through the characters in the hexadecimal number the procedure presents a message box with the decimal value of the hexadecimal number in TextBoxI. Private Sub Button4_Click ByVal sender As _ ByVal e As Handles Call program to convert a hexadecimal number to a Long number. ConvertHexToLng End Sub Sub ConvertHexToLng Assign TextBoxI contents to hexStr. Dim strValue As String Dim hexStr As String If hexStr greater than 7FFFFFFFFFFFFFFF then abort. Dim hexchars As Integer Len hexStr If hexchars 16 And O 7 Or _ hexchars 16 Then MsgBox Hex values beyond 7FFFFFFFFFFFFFFF _ generate an exception. Enter a smaller _ hex value. Exit Sub End If Variable lnghexstr stores long of hex string in TextBoxI and i is a loop counter value. Dim lnghexstr As Long Dim i As Integer Loop through .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.