|
1 members (Russ),
10,950
guests, and
1,516
robots. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
S |
M |
T |
W |
T |
F |
S |
|
|
|
1
|
2
|
3
|
4
|
5
|
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
|
27
|
28
|
29
|
30
|
31
|
|
|
|
|
This is another custom island. This one could be used for ads. This spot is one of the best places for ads on your site to be placed. This can be enabled/disabled on a per forum basis.
|
|
|
|
Joined: Dec 1999
Posts: 30,868
Master Elite Member
|
Public Function AsLong_ByteArray(ByteArray() As Byte) As Long
'Purpose
' Used to convert a byte array to a long.
'Parameters
' ByteArray (Byte()) = The byte array to convert.
'Return (Long)
' Returns the specified byte array as a long.
' If the specified byte array has no elements, function returns zero.
'Dependencies
' ElementCount
'Entry Conditons
' The specified byte array must be convertable to a long by the VB CLng() function or this function will crash.
'Notes
' This is an example of an "unpacked" long with a value of 12:
' (0) 0 (1) 0 (2) 1 (3) 2
' This "unpacked" format stores the actual decimal value of each decimal "place" in each element.
' It *does not* store the ASCII value of characters which represent the value.
' Note that the LSB is the one with the highest index.
'Version History
' 1.0 5/28/2004 Tested by Russ Tanner
'---
'Initiate variables
Dim C As Long 'Loop counter
Dim eCount As Long 'The number of elements in the parsed byte array
Dim X As String 'String buffer for returned long (before being converted to a long)
'Get the element count of the parsed byte array
eCount = elementCount(ByteArray)
'Trap: The specified byte array is empty, function always return zero
If eCount = 0 Then
asLong_ByteArray = 0
Exit Function
End If
'Main loop: Build a string from the (unpacked) elements of the byte array
For C = 0 To eCount - 1
X = X & Trim(CStr(ByteArray(C)))
Next C
'Convert the string into a long and return the result
asLong_ByteArray = CLng(X)
End Function
|
|
|
|
|