Results 1 to 1 of 1

Thread: Quick Scratch area to get code between machines.

  1. #1

    Thread Starter
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,530

    Quick Scratch area to get code between machines.

    Code:
    Public Class Form1
      Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim d As Double
        Dim L As Long
    
        d = 1.0
        L = BitConverter.ToInt64(BitConverter.GetBytes(d), 0)
        Debug.Print("1.0 image to Long = {0:x16}", L)
    
        d = 2.0
        L = BitConverter.ToInt64(BitConverter.GetBytes(d), 0)
        Debug.Print("2.0 image to Long = {0:x16}", L)
    
        L = &H4008000000000000
        d = BitConverter.ToDouble(BitConverter.GetBytes(L), 0)
        Debug.Print("Long value = {0:x16)}, double value = {1}", L, d.ToString)
    
      End Sub
    End Class
    Code:
    1.0 image to Long = 3ff0000000000000
    2.0 image to Long = 4000000000000000
    Long value = 4008000000000000, double value = 3
    Last edited by passel; Feb 8th, 2022 at 11:55 PM.
    "Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width