How about the deletion function.i just modify the insert function to delete function.is it correct.actualy i would like to delete if 04 FF 04 FF (got repeating value) i would like to delete one of the 04 FF.So can i use the function that i modify .The same thing i wana do as insert function but i wana delete this time the condition is if there is repeating value as i mentioned just now. - Public Function DeleteByte(pmArray() As Byte, pmPosition As Long, ByVal pmNewValue As Byte)
-
' Function to delete a new byte value into a byte array.
-
Dim ArrayStart As Long, ArrayEnd As Long
-
Dim I As Long
-
ArrayStart = LBound(pmArray)
-
ArrayEnd = UBound(pmArray) -1
-
' Expand array to make room for the new value.
-
ReDim Preserve pmArray(ArrayStart To ArrayEnd)
-
' If requested position is outside the array, just stick it
-
' at the start or end as appropriate.
-
If pmPosition < ArrayStart Then
-
pmPosition = ArrayStart
-
End If
-
If pmPosition > ArrayEnd Then
-
pmPosition = ArrayEnd
-
End If
-
' Unless adding to the end of the array,
-
' push everything across to make room.
-
If pmPosition < ArrayEnd Then
-
For I = ArrayEnd To pmPosition -1 Step -1
-
pmArray(I) = pmArray(I - 1)
-
Next
-
End If
-
pmArray(pmPosition) = pmNewValue
-
End Function
36 3439
I don't think the code is quite right. But before we get into the code, I'd like you to try and state fairly simply, the method to be used. In other words, can you describe to me, in a fairly simple overview, how you would go about removing a value from the middle of an array?
Turning it into code is quite simple, and we'll get that done quite quickly. But first you have to understand what you're trying to code.
I'll give you a hint. It's not the same sort of process as inserting. If you start by shortening the array, you've just thrown away whatever was at the end of it.
Actualy are u saying that it is not possible to delete the byte in the middle of array.My problem is now - 04 FF 89 67 87 90 89 04 FF 04 FF
-
89 65 67 78 93 78 78 89 84 67 04
-
i wana delete one of the repeating 04 FF in the array of byte.is it possible in vb?
Actualy when i insert one i have delete one of the 04 FF value in my program
The arrangement of array sometime like 04 FF 04 FF.So when i insert one 04 FF,i should delete one 04 FF.so i have to find the position where should i delete,sowhen there is repeating value like 04 FF 04 FF ,so i wana delete 1 of the 04 FF.So i have to check until EOF to find out the location to be deleted.So i think it will be explain problem more clear.
Certainly it's possible to remove a value from the middle of an array. I'd just like you to think about how you would go about removing one from somewhere in the middle.
You might try thinking of the array as a row of boxes, or something similar. What would be the steps involved in taking one out of the middle and not leaving a gap? If you can explain that in detail, you will be very close to writing the code for it.
(Note, here I'm just talking about the actual removal of a byte. This has nothing to do with deciding what byte to remove.)
-
-
-
04 FF F2 03 37 04 04 FF- F1 03 37 04 04 FF F0 03
-
37 04 04 FF EF 03 37 04 - 04 FF 04 FF EE 03 37 04
-
04 FF ED 03 37 04 04 FF- EC 03 37 04 04 FF EB 03
-
-
For eg i wana find out where the repeating value of 04 FF 04 FF occur,then i wana delete one of the 04 FF
then i wana merge the array. -
-
-
04 FF F2 03 37 04 04 FF - F1 03 37 04 04 FF F0 03
-
37 04 04 FF EF 03 37 04 - 04 FF EE 03 37 04 04 FF
-
ED 03 37 04 04 FF EC 03 - 37 04 04 FF EB 03 89 67
-
-
-
This is i wana do after the insertion and do deletion also.How to start?Wana check until EOF and do deletion as the location where there is repeating structure
You keep jumping ahead. I'm still trying to get you to spell out how you would go about removing a byte from an array. Let's get working tools before we try to use them, huh?
sir so how if u give a function that delete byte from array as u give me as insertion function.Like delete a value from array of byte as starting so that i can understand more[/font]
how to delete a value from a byte of array.like HELLO.i wana delete the 2nd value.How i can do in vb
how to delete a value from a byte of array.like HELLO.i wana delete the 2nd value.How i can do in vb
Now that I think about if further, if you are just looking to replace duplicated strings, I think it will be much simpler to work with a string. You probably won't need the "delete a byte" routine.
Let's assume, for the sake of argument, that you have read your file into string variable strText, instead of a byte array. I think the Replace() function might do the fix for you, all in one go, like so... - Dim strLookFor As String, strChangeTo As String
-
strChangeTo = Chr$(&H04) & Chr$(&HFF)
-
strLookFor = strChangeTo & strChangeTo
-
strFile = Replace(strFile, strLookFor, strChangeTo)
- public function delete( )
-
-
Dim strLookFor As String, strChangeTo As String
-
strChangeTo = Chr$(&H4) & Chr$(&HFF)
-
strLookFor = strChangeTo & strChangeTo
-
strFile = Replace(strFile, strLookFor, strChangeTo)
-
-
end sub
-
-
Can i used the function.It can do deletion is it.....is it deleting the repeating value.can i call the function as i did in the insertion part....open the binary file and check it out until EOF to check whether there is repeating structure....and do replacement..
Here's a code module containing a function which I think will do the trick. You need to call it, passing the file name, the string to look for (04 FF 04 FF) and the string to replace it with (04 FF). Hopefully, it will do the rest. I haven't tested it, though... - Option Explicit
-
DefLng A-Z
-
-
Private strFileData As String, strOriginalData As String
-
-
Public Function ZapDuplicates(ByVal strFileName As String, strLookFor As String, strChangeTo As String) As Boolean
-
' Returned value indicates whether the file was actually changed.
-
Dim FileNo As Long
-
FileNo = FreeFile
-
Open strFileName For Binary Access Read Shared As #FileNo
-
strFileData = Space$(LOF(FileNo))
-
Get #FileNo, , strFileData
-
Close #FileNo
-
strOriginalData = strFileData
-
-
strFileData = Replace(strFileData, strLookFor, strChangeTo)
-
If strOriginalData <> strFileData Then
-
If MsgBox("Data changed - rewrite file?", vbQuestion + vbYesNo) = vbYes Then
-
Open strFileName For Output Access Write Lock Write As #FileNo
-
Print #FileNo, strFileData;
-
Close #FileNo
-
ZapDuplicates = True
-
End If
-
End If
-
strOriginalData = ""
-
strFileData = ""
-
End Function
I hope you will think carefully about the parameters. If you plug in the actual string "04 FF" I'll be disappointed.
- Private Sub CMDFIND_Click()
-
-
If lblFileSpec.Caption = "" Then
-
Exit Sub
-
End If
-
txbSearch.Text = "04FF04FF"
-
picHexDisp.SetFocus
-
doHexSearch
-
End Sub
-
-
-
Private Sub doHexSearch()
-
On Error Resume Next
-
Dim HexCtn As Integer
-
Dim I, J
-
Dim mMatch As Boolean
-
Dim foundStartPos As Long
-
Screen.MousePointer = vbHourglass
-
HexCtn = Len(txbSearch.Text) / 2
-
ReDim arrHexByte(1 To HexCtn)
-
For I = 1 To HexCtn
-
arrHexByte(I) = CByte("&h" & (Mid(txbSearch.Text, (I * 2 - 1), 2)))
-
Next I
-
foundStartPos = prevFoundPos + 1
-
For I = foundStartPos To (UBound(arrByte) - (HexCtn - 1))
-
If arrByte(I) = arrHexByte(1) Then
-
mMatch = True
-
' Compare rest bytes
-
For J = 1 To (HexCtn - 1)
-
If arrByte(I + J) <> arrHexByte(1 + J) Then
-
mMatch = False
-
Exit For
-
End If
-
Next J
-
If mMatch = True Then
-
Dim k
-
foundStartPos = I
-
prevFoundPos = I
-
k = (foundStartPos + 1) / CLng(mPageSize)
-
k = NoFraction(k)
-
pageStart = k * mPageSize + 1
-
pageEnd = pageStart + mPageSize - 1
-
If pageEnd > mFileSize Then pageEnd = mFileSize
-
k = foundStartPos + (HexCtn - 1)
-
If k > pageEnd Then k = pageEnd
-
updEditByte
-
ShowPage True, foundStartPos, k, &HFFFF00, vbRed
-
Screen.MousePointer = vbDefault
-
Exit Sub
-
End If
-
End If
-
Next I
-
Screen.MousePointer = vbDefault
-
prevFoundPos = 0
-
MsgBox txbSearch.Text & vbCrLf & vbCrLf & "Searched to end."
-
End Sub
-
-
-
Function NoFraction(ByVal inVal As Variant) As Long
-
Dim X As Integer
-
Dim tmp As String
-
Dim k As Long
-
tmp = CStr(inVal)
-
X = InStr(tmp, ".")
-
If X > 0 Then
-
tmp = Left(tmp, X - 1)
-
End If
-
k = Val(tmp)
-
NoFraction = k
-
End Function
This is the function that I did to find out the string 04 FF 04 FF.So assign it to text box and when I click the FIND button it find from beginning of file until end. So is it correct way and give me some comments how I can enhance it on how it can find out the value without I click each time as find next value. So when I find out the value may be I can use the function that you give previously as making 04 FF 04 FF To 04 FF. Need your help?
The function that I provided in my last post will find and replace all occurrences of the string in the file, not just one.
sir am i doing rite sir.So can i use the function to find the string and use the function that u give to replace it
-
-
-
-
-
-
Option Explicit
-
DefLng A-Z
-
-
Private strFileData As String, strOriginalData As String
-
-
Public Function ZapDuplicates(ByVal strFileName As String, strLookFor As String, strChangeTo As String) As Boolean
-
' Returned value indicates whether the file was actually changed.
-
Dim FileNo As Long
-
FileNo = FreeFile
-
Open strFileName For Binary Access Read Shared As #FileNo
-
strFileData = Space$(LOF(FileNo))
-
Get #FileNo, , strFileData
-
Close #FileNo
-
strOriginalData = strFileData
-
-
strFileData = Replace(strFileData, strLookFor, strChangeTo)
-
If strOriginalData <> strFileData Then
-
If MsgBox("Data changed - rewrite file?", vbQuestion + vbYesNo) = vbYes Then
-
Open strFileName For Output Access Write Lock Write As #FileNo
-
Print #FileNo, strFileData;
-
Close #FileNo
-
ZapDuplicates = True
-
End If
-
End If
-
strOriginalData = ""
-
strFileData = ""
-
End Function
-
-
private command1_click( )
-
-
call Function ZapDuplicates(a:\bonding.bin,04 FF 04 FF,04 FF)
-
-
end sub
-
-
-
i do no wheather im doing rite or not...Am i rite?
There's no need to create a function called Replace. The Replace function is built into VB.
Also, in this line... call Function ZapDuplicates(a:\bonding.bin,04 FF 04 FF,04 FF)
your parameters just don't make any sense. The ZapDuplicates function expects three parameters, all strings. You should read the documentation and get familiar with the basics like how to pass a parameter to a function, and how to specify a string.
- Private Sub Command2_Click() Dim i As String
-
Dim b As String
-
Dim m As String
-
Dim strLookFor As String
-
Dim strFileName As String
-
Dim strChangeTo As String
-
strChangeTo = Chr$(&H4) & Chr$(&HFF)
-
strChangeTo = i
-
strLookFor = strChangeTo & strChangeTo
-
strLookFor = b
-
strFileName = "a:/bonding.bin"
-
strFileName = m
-
Call ZapDuplicates(m, b, i)
-
End Sub
-
am i doing rite in passing the parameter?
Try this... - Private Sub Command2_Click()
-
' Dim i As String
-
' Dim b As String
-
' Dim m As String
-
Dim strLookFor As String
-
Dim strFileName As String
-
Dim strChangeTo As String
-
strChangeTo = Chr$(&H4) & Chr$(&HFF)
-
' strChangeTo = i <-- What is this for?
-
strLookFor = strChangeTo & strChangeTo
-
' strLookFor = b <-- What is this for?
-
strFileName = "a:\bonding.bin"
-
' strFileName = m <-- What is this for?
-
Call ZapDuplicates(strFileName, strLookFor, strChangeTo)
-
End Sub
-
For some reason, you were placing values in strFileName, strLookFor and strChangeTo, then throwing them away by replacing them with empty strings from i, b and m. (Also, note I changed the slash to a backslash in the file name.)
-
-
-
Private Sub Command1_click()
-
Dim mHandle
-
mHandle = FreeFile
-
Open "a:\bonding.bin" For Binary Access Read Write Lock Write As mHandle
-
ReWrite_Open_File mHandle
-
End Sub
-
-
Public Function ZapDuplicates(ByVal strFilename As String, strLookFor As String, strChangeTo As String) As Boolean
-
' Returned value indicates whether the file was actually changed.
-
Dim FileNo As Long
-
FileNo = FreeFile
-
Open strFilename For Binary Access Read Shared As #FileNo
-
strFileData = Space$(LOF(FileNo))
-
Get #FileNo, , strFileData
-
Close #FileNo
-
strOriginalData = strFileData
-
strFileData = Replace(strFileData, strLookFor, strChangeTo)
-
If strOriginalData <> strFileData Then
-
If MsgBox("Data changed - rewrite file?", vbQuestion + vbYesNo) = vbYes Then
-
Open strFilename For Output Access Write Lock Write As #FileNo
-
Print #FileNo, strFileData;
-
Close #FileNo
-
ZapDuplicates = True
-
End If
-
End If
-
strOriginalData = ""
-
strFileData = ""
-
End Function
-
-
-
-
Public Sub ReWrite_Open_File(ByVal FileNo As Long)
-
-
Const a As Byte = 4
-
Const b As Byte = &HFF
-
Dim i As Long
-
Dim AnyChanged As Boolean
-
Dim J As Long
-
Dim strLookFor As String
-
Dim strChangeTo As String
-
Dim strFilename As String
-
' This little array will be used to hold the "before" values,
-
' so we can display them.
-
Dim HoldByte(1 To 6) As Byte
-
-
mFileSize = LOF(FileNo) ' Determine how large the file is (in bytes).
-
ReDim Buffer(1 To mFileSize) ' Set our buffer to that length.
-
Get #FileNo, 1, arrByte ' Grab the entire file's data into the array
-
-
-
-
i = 49
-
' Note, not using a FOR loop, as the end-point may shift during processing.
-
Do Until i >= mFileSize - 6
-
' Make a copy of this chunk of data, so we can display the
-
' "before" version after changing it.
-
For J = 1 To 6
-
HoldByte(J) = arrByte(i + J - 1)
-
Next
-
AnyChanged = False
-
-
-
If arrByte(i) <> a Then
-
InsertByte arrByte, i, a ' Identified a missing byte. Insert it.
-
mFileSize = mFileSize + 1 ' Reflect the addition of 1 byte to the array.
-
changemade = True
-
End If
-
If arrByte(i + 1) <> b Then
-
InsertByte arrByte, i + 1, b
-
mFileSize = mFileSize + 1 ' Reflect the addition of 1 byte to the array.
-
changemade = True
-
End If
-
' If we changed this chunk of data, report the change.
-
If changemade Then
-
AnyChanged = True
-
' This demonstrates how useful user-defined functions can be...
-
' Note, since we are reporting only the parts actually changed, you might
-
' want to try putting it in a RichTextBox again; the performance should be
-
' somewhat improved. (You could use a plain TextBox, too).
-
Debug.Print "Before ("; Format(i, "000000"); ") : "; FormattedByteArray(HoldByte, 1, 6)
-
Debug.Print "After ("; Format(i, "000000"); ") : "; FormattedByteArray(arrByte, i, i + 5)
-
Debug.Print
-
End If
-
i = i + 6
-
Loop
-
-
If AnyChanged Then
-
If MsgBox("Write data back to the file?", vbYesNo) = vbYes Then
-
Put #FileNo, 1, arrByte() ' Write the data back to the file.
-
End If
-
End If
-
-
strChangeTo = Chr$(&H4) & Chr$(&HFF)
-
-
strLookFor = strChangeTo & strChangeTo
-
-
strFilename = "a:\bonding.bin"
-
-
Call ZapDuplicates(strFilename, strLookFor, strChangeTo)
-
-
when i append the duplicate and rewrite function together it give the error saying that file already open....i wana do deletion rite after insertion .
Just close the file before calling ZapDuplicates.
- close #fileNo
-
strChangeTo = Chr$(&H4) & Chr$(&HFF)
-
-
-
strLookFor = strChangeTo & strChangeTo
-
-
strFilename = "a:\bonding.bin"
-
-
Call ZapDuplicates(strFilename, strLookFor, strChangeTo)
-
-
-
When i put the close #fileNo the output is not correct.When i do seperately it giving correct output.When i do together the 2 function the output is not correct.Why it is happening?
At a guess, you are inserting bytes which are preventing you from finding the duplicates. Have you tried doing them the other way around? That is, first zap duplicates, then insert missing bytes.
THANK YOU VERY MUCH SIR........the guidance that u give realy make the thing run correctlyREALY APPERICIATE SIR .U R REALY GREAT KILLER42.THANKS ALOT AGAIN FOR UR GUIDANCE AND THIS WEBSITE REALY GREAT
Well, thanks. I guess it's nice to be appreciated sometimes. But we're usually glad to be able to help, around here.
- Private Sub lblrewrite_Click()
-
-
Dim strLookFor As String
-
Dim strFileName As String
-
Dim strChangeTo As String
-
Dim mHandle
-
-
strChangeTo = Chr$(&H4) & Chr$(&HFF)
-
-
strLookFor = strChangeTo & strChangeTo
-
-
strFileName = "a:\bonding.bin"
-
-
Call ZapDuplicates(strFileName, strLookFor, strChangeTo)
-
-
mHandle = FreeFile
-
Open "a:\bonding.bin" For Binary Access Read Write Lock Write As mHandle
-
ReWrite_Open_File mHandle
-
End Sub
-
-
-
Public Function ZapDuplicates(ByVal strFileName As String, strLookFor As String, strChangeTo As String) As Boolean
-
' Returned value indicates whether the file was actually changed.
-
Dim FileNo As Long
-
FileNo = FreeFile
-
Dim tmp
-
Open strFileName For Binary Access Read Shared As #FileNo
-
strFileData = Space$(LOF(FileNo))
-
Get #FileNo, , strFileData
-
Close #FileNo
-
strOriginalData = strFileData
-
strFileData = Replace(strFileData, strLookFor, strChangeTo)
-
If strOriginalData <> strFileData Then
-
tmp = MsgBox("Data changed - rewrite file?", vbQuestion + vbYesNo, "Data Changed")
-
If tmp = vbYes Then
-
MousePointer = vbHourglass
-
Open strFileName For Output Access Write Lock Write As #FileNo
-
Print #FileNo, strFileData;
-
Close #FileNo
-
ZapDuplicates = True
-
ElseIf tmp = vbNo Then
-
Unload Me
-
End If
-
End If
-
strOriginalData = ""
-
strFileData = ""
-
End Function
-
-
-
-
Public Sub ReWrite_Open_File(ByVal FileNo As Long)
-
-
Const a As Byte = 4
-
Const b As Byte = &HFF
-
Dim I As Long
-
Dim AnyChanged As Boolean
-
Dim j As Long
-
Dim strLookFor As String
-
Dim strFileName As String
-
Dim strChangeTo As String
-
strChangeTo = Chr$(&H4) & Chr$(&HFF)
-
' This little array will be used to hold the "before" values,
-
' so we can display them.
-
Dim HoldByte(1 To 6) As Byte
-
' PART 1: Read the file into a Byte array
-
' =======================================
-
mFileSize = LOF(FileNo) ' Determine how large the file is (in bytes).
-
ReDim Buffer(1 To mFileSize) ' Set our buffer to that length.
-
Get #FileNo, 1, arrByte ' Grab the entire file's data into the array
-
-
-
' PART 2: Scan the array for dropped bytes and insert them
-
' ========================================================
-
MousePointer = vbHourglass
-
I = 49
-
' Note, not using a FOR loop, as the end-point may shift during processing.
-
Do Until I >= mFileSize - 10
-
' Make a copy of this chunk of data, so we can display the
-
' "before" version after changing it.
-
For j = 1 To 6
-
HoldByte(j) = arrByte(I + j - 1)
-
Next
-
AnyChanged = False
-
-
' Check for missing bytes and insert.
-
If arrByte(I) <> a Then
-
InsertByte arrByte, I, a ' Identified a missing byte. Insert it.
-
mFileSize = mFileSize + 1 ' Reflect the addition of 1 byte to the array.
-
changeMade = True
-
End If
-
If arrByte(I + 1) <> b Then
-
InsertByte arrByte, I + 1, b
-
mFileSize = mFileSize + 1 ' Reflect the addition of 1 byte to the array.
-
changeMade = True
-
End If
-
' If we changed this chunk of data, report the change.
-
If changeMade Then
-
AnyChanged = True
-
' This demonstrates how useful user-defined functions can be...
-
' Note, since we are reporting only the parts actually changed, you might
-
' want to try putting it in a RichTextBox again; the performance should be
-
' somewhat improved. (You could use a plain TextBox, too).
-
Debug.Print "Before ("; Format(I, "000000"); ") : "; FormattedByteArray(HoldByte, 1, 6)
-
Debug.Print "After ("; Format(I, "000000"); ") : "; FormattedByteArray(arrByte, I, I + 5)
-
Debug.Print
-
End If
-
I = I + 6
-
Loop
-
-
' PART 3: If data was changed, write it back to the file
-
' ======================================================
-
If AnyChanged Then
-
If MsgBox("Write data back to the file?", vbYesNo, "DELETED DATA REPAIRER") = vbYes Then
-
Put #FileNo, 1, arrByte() ' Write the data back to the file.
-
Close #1
-
MousePointer = vbDefault
-
MsgBox "SCANNING AND REWRITING PROCESS FINISHED", vbOKOnly + vbInformation, "FINISHED"
-
End If
-
End If
-
-
-
End Sub
I got problem with this code...please help me on how i can do insertion then deletion.This function is doing insertion to until end of file.But i wana do insertion of 04 FF followed by deletion of 04FF.How i can make this?
Before (292531) : D2 03 04 FF 12 04
After (292531) : 04 FF D2 03 04 FF
Before (292537) : 12 04 D2 03 04 FF
After (292537) : 04 FF 12 04 D2 03
When we insert 04 FF in front of D2 it become 04 FF D2 03 04 FF, The value will move after we insert the first value.After do the first insertion i wana do first deletion ......how i can do this?
Sorry, very busy right now. I'll have to get back to you on this. Probably next week, as it looks like a busy weekend.
killer 42 i need ur help
I apologise for the delay. The problem is that this one requires some thought. At the moment, I only have time to pop in briefly and bang out a couple of quick messages.
I hope you are still attempting to get this working yourself?
ya i need ur giudanece on this.
can u give mo some hidden how i can make this...
Actually this is another deletion function. I do no how to do it.
I want to make 3 conditions like this -
- 04 FF x 04 FF X X X X 04 FF X X X X or
- 04 FF x x 04 FF X X X X 04 FF X X X X or
- 04 FF x x x 04 FF X X X X04 FF X X X X
-
x= any values
If the condition is correct I want to delete the highlighted values and move the values after the deleted values after correspond condition is reached.
How can I make this? I want to check the file until end of file and if the condition occurs I want to delete the values that highlight. How can I can that?
After delete I want to insert back the values at the corresponding place.
Actually the arrangement of the data in the file follows this trend - 04 FF X X X X
-
04 FF X X X X
-
04 FF X X X X
- 04 FF X
-
04 FF X X X X
-
04 FF X X X X
- X X X
-
04 FF X X X X
-
-
I want to make the above thing like this - 04 FF X X X X
-
04 FF X X X X
-
04 FF X X X X
- (delete the value )
-
04 FF X X X X
-
04 FF X X X X
- 04 FF XX X X (put in front of X X X X)
-
04 FF X X X X
-
This is the problem. When the data is corrupted and the data looks like this and after the repair look like above. Actually the data is arranged in 16 byte. The above is just eg. How can I make this?
After reading through the final examples here, I think I'm getting a better idea of what you're after. With luck, I might be able to work it out for you by about this time tomorrow.
killer 42 hopefully u can help me by today.thanks....
I'm looking into this now. Hopefully will have something soon.
Ok, here's what I've developed. In principle, I believe it should work. But it is entirely untested and thus should be treated with great caution.
I've written the routine from scratch. It reads in each byte in turn and tries to build up the 16 byte "field" starting with the two-byte "flag". If it doesn't find the flag it inserts it. If it does find the flag, but finds another one too soon (short record) then it discards the short one. Otherwise, it copies the entire "field" to an output buffer. Once it gets to the end, it checks the output buffer and if it's different to what we started with (and the user says Yes) then it overwrites the file.
That's the theory, anyway. As I said, it's not tested. In fact I've already jumped back into VB and corrected at least three bugs while I was typing this message.
The idea is that the data is made up of a series of :"fields", each of which starts with a "flag". The size of the field (16 in this case) and the flag (04FF in this case) can be specified as parameters to the function. Note that the length of the flag is included in the length of the field. That should mean that your data is made up of two flag bytes (04 FF) followed by 14 data bytes. If I've got that wrong, just adjust the FieldSize parameter you pass.
I can't contain my curiosity any longer - did it work?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Shea Martin |
last post by:
Which of the following do I use delete instead of just delete.
//1.)
// not sure about this one, as char is of size 1
char *str = new char;
//2.)
//not sure about this one, as it is a...
|
by: Jonan |
last post by:
Hello,
For several reasons I want to replace the built-in memory management with
some custom built. The mem management itlsef is not subject to my question -
it's ok to the point that I have...
|
by: jeff |
last post by:
how do you convert form byte to Int32 while retaining the binary
value of the byte array
|
by: Richard Arthur |
last post by:
This is a weird problem.
1) I use MediaDet to save a bitmap in a temporary file.
2) I create a bitmap using that temporary file's name.
3) I use the bitmap.
4) I want to destroy the file when...
|
by: Aston Martin |
last post by:
Hi All,
********************** My Situation **********************
I am working on project that involves passing a structure to unmanaged
code from .Net world (well using C#). Perhaps an example...
|
by: Money |
last post by:
If I allocate memory like this
int *ptr = new int;
Can I apply delete ptr; instead of delete ptr; since I am only
allocating memory for 1 integer.
|
by: Jon Slaughter |
last post by:
Is it safe to remove elements from an array that foreach is working on?
(normally this is not the case but not sure in php) If so is there an
efficient way to handle it? (I could add the indexes to...
|
by: kirubagari |
last post by:
is it possible to do deletion in visual basic.
1.04 FF F2 03 37 04 04 FF - FF 03 37 04 04 FF F0 03.....line 1
2.37 04 04 FF EF 03 37 04 - 04 FF 04 FF EE 03 37 04.....line 2
3.04 FF ED 03 37 04...
|
by: Tristan Wibberley |
last post by:
Hi
I've got implementing overloaded operator new and delete pretty much
down. Just got to meet the alignment requirements of the class on which
the operator is overloaded.
But how does one...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |