Convert from vb.net to vb6
Convert from vb.net to vb6
Convert from vb.net to vb6
Convert from vb.net to vb6
Convert from vb.net to vb6
Convert from vb.net to vb6 Convert from vb.net to vb6 Convert from vb.net to vb6 Convert from vb.net to vb6 Convert from vb.net to vb6 Convert from vb.net to vb6 Convert from vb.net to vb6 Convert from vb.net to vb6
Convert from vb.net to vb6 Convert from vb.net to vb6
Convert from vb.net to vb6
Go Back  Xtreme Visual Basic Talk > > > Convert from vb.net to vb6


Reply
 
Thread Tools Display Modes
  #1  
Old 12-27-2016, 02:33 AM
iscode iscode is offline
Newcomer
 
Join Date: Mar 2009
Posts: 16
Default Convert from vb.net to vb6


I have small program in vb.net I am trying to convert to vb6 code
Can anyone help me with this?

Code:
Imports System
Imports Microsoft.VisualBasic
				
Public Module Module1
	'Xor all the binary digits of 'input'.
	Public Function Parity(input As Integer) As Integer
		Dim output As Integer = 0
		While input <> 0
			output = output Xor (input And 1)
			input = input >> 1
		End While
		Return output
	End Function
	
	'Move the 2 least significant bits into the most significant positions.
	'Assume the input is 16 bits long (i.e. 4 hexadecimal digits).
	Public Function LeftRotateBy2(input As Integer) As Integer
		Return ((input And 3)<<14) Or (input>>2)
	End Function
	
	'Convert 'input' into a 'numDigits' digit hexadecimal string
	Public Function ConvertToHex(input As Integer, numDigits As Integer) As String
		Dim hexDigits As String = "0123456789ABCDEF"
		Dim output As String = ""
		For i As Integer = 1 To numDigits
			output = Mid(hexDigits, (input And 15)+1, 1) & output
			input = input >> 4
		Next
		Return output
	End Function
	
	'Create table
	Public Sub Main()
		Dim result As Integer
		Dim resultHiDigits, resultLoDigits As Integer
		For n As Integer = 0 To 255
			result = LeftRotateBy2((Parity(n)*7<<8) Xor n Xor (n<<1))
			'Split result into two
			resultHiDigits = result>>8
			resultLoDigits = result And 255
			'Display result as two 2 digit hexadecimal numbers
			Console.WriteLine("{0,3} : {1} {2}", n,
				ConvertToHex(resultHiDigits, 2),
				ConvertToHex(resultLoDigits, 2))
		Next
	End Sub
End Module
Reply With Quote
Reply

Tags
integer, input, output, function, dim, public, string, return, numdigits, convert, digits, result, significant, bits, hexadecimal, vb6, vb.net, imports, xor, 0123456789abcdef, digit, hexdigits, converttohexinput, program, i.e


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Convert from vb.net to vb6
Convert from vb.net to vb6
Convert from vb.net to vb6 Convert from vb.net to vb6
Convert from vb.net to vb6
Convert from vb.net to vb6
Convert from vb.net to vb6 Convert from vb.net to vb6 Convert from vb.net to vb6 Convert from vb.net to vb6 Convert from vb.net to vb6 Convert from vb.net to vb6 Convert from vb.net to vb6
Convert from vb.net to vb6
Convert from vb.net to vb6
 
Convert from vb.net to vb6
Convert from vb.net to vb6
 
-->