From: Boris P. on 27 Jun 2010 03:07 In Java there is a method called "readInt" for a data input stream. I thought that I could simply port this method to VB6 by using dim l& 'I guess that a Java integer is a long in VB6 Get #m_IFile, , l But that does not really return the same value as I get in Java. Can anybody help?
From: Boris P. on 27 Jun 2010 04:40 I found the problem now... dim l& Get #m_iFile, , l Dim s$ s = "&H" & Hex(l) "s" is now close to value in Java. But there is a problem which I don't understand. The values in s are "reversed". They read DDCCBBAA while they should read AABBCCDD Does anybody know what I'm doing wrong?
From: Boris P. on 27 Jun 2010 04:59 Here is how it works for me as it should, but it looks so damn ugly... Is there a way to make this quicker (in aspects of speed) and more beautiful? Public Function readInt() As Long Dim b(3) As Byte Get #m_iFile, , b() Dim sThis$ sThis = "&H" Dim l& For l = 0 To UBound(b) sThis = sThis & Hex(b(l)) Next l readInt = CLng(sThis) End Function
From: Larry Serflaten on 27 Jun 2010 05:42 "Boris P." <bpnotvalid(a)nospamhotmail.com> wrote > Here is how it works for me as it should, but it looks so damn ugly... > Is there a way to make this quicker (in aspects of speed) and more > beautiful? Exactly what is in the file (How many bytes per value, and what are the byte values) and what does Java's readInt return for those bytes? LFS
From: Boris P. on 27 Jun 2010 05:46 Hi Larry, I don't know yet what exactely is in the file, but I need to import it. Java behaves just like my own function which I have posted in my last submission (the function "readInt" in VB6 format).
|
Next
|
Last
Pages: 1 2 3 Prev: How to use the FindText and ReplaceText API Next: Hiding listview columns |