|
-
Aug 8th, 2002, 12:18 PM
#1
Thread Starter
Hyperactive Member
delphi -> Vb
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.
Craig Johnstone, MCP,CNA
VB 6,SQL,Lotus Notes,Crystal Reports 7,8
http://www.cajsoft.co.uk/downloads.htm
-
Aug 8th, 2002, 12:30 PM
#2
PowerPoster
cajsoft,
you cannot convert it - you will have to write your own code instead.
Roy
-
Aug 8th, 2002, 12:48 PM
#3
Thread Starter
Hyperactive Member
Shifting Bits left and right
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.
Craig Johnstone, MCP,CNA
VB 6,SQL,Lotus Notes,Crystal Reports 7,8
http://www.cajsoft.co.uk/downloads.htm
-
Aug 8th, 2002, 12:55 PM
#4
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
-
Aug 8th, 2002, 06:04 PM
#5
Thread Starter
Hyperactive Member
Thanks for that.. worked a treat.
Craig Johnstone, MCP,CNA
VB 6,SQL,Lotus Notes,Crystal Reports 7,8
http://www.cajsoft.co.uk/downloads.htm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|