Hi,
Does anyone know of any apps or source that I can use to convert some delphi source code into vb as I know nothing about delphi... and dont intend to..
Regards.
Printable View
Hi,
Does anyone know of any apps or source that I can use to convert some delphi source code into vb as I know nothing about delphi... and dont intend to..
Regards.
cajsoft,
you cannot convert it - you will have to write your own code instead.
Roy
Ok.
so what is the VB function or statement to shift bits left or right?
in delphi SHL and SHR are used... same as assembly.
there is no bitshift in VB
here is a function to emulate it
Code:
Public Enum ShiftDirections
SHIFT_left = 0
SHIFT_right = 1
End Enum
Public Function BitShift(lValue As Long, _
ByVal lDir As ShiftDirections, _
ByVal iBitCount As Integer) As Long
Dim iBitsToShift As Integer
' negative powers of 2 will produce a division
' (right shift)
iBitsToShift = IIf(lDir = SHIFT_right, -iBitCount, iBitCount)
On Error GoTo ShiftErrHandler
BitShift = Fix(lValue * 2 ^ iBitsToShift)
Exit Function
ShiftErrHandler:
' overflow or other invalid error occurred
MsgBox Err.Description
End Function
Thanks for that.. worked a treat.