Results 1 to 5 of 5

Thread: delphi -> Vb

  1. #1

    Thread Starter
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295

    Unhappy 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

  2. #2
    PowerPoster
    Join Date
    Aug 2002
    Location
    NY, NY
    Posts
    2,139
    cajsoft,
    you cannot convert it - you will have to write your own code instead.

    Roy

  3. #3

    Thread Starter
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295

    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

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    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
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5

    Thread Starter
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295
    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
  •  



Click Here to Expand Forum to Full Width