Gaming Community
Forum
 
Go Back   D3scene > Software/Hardware > Development
Register Blogs Live view Downloads Marketplace FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

[CODE] [VB6] Bit XOR Function

This is a discussion on [CODE] [VB6] Bit XOR Function within the Development forum part of the Software/Hardware category; These functions below take a binary string ... [0's and 1's] and inverts the bit first one gives the binary ...


Welcome on D3scene.com! Make sure to register - it's free and very quick! You have to register before you can post and participate in our discussions with 70000 other registered members. Downloads, user profiles and some forums can only be seen by registered members. After you create your free account you will be able to customize many options, you will have the full access to new hacks, latest cheats and last but not least will see no advertisements at all. We would love to see you around in our community!
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 01-19-2008, 05:42 AM
Kalbintion's Avatar
Premium Member

 
Join Date: Aug 2007
Posts: 1,111
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Reputation: 318
Rep Power: 4
Kalbintion is a jewel in the roughKalbintion is a jewel in the roughKalbintion is a jewel in the roughKalbintion is a jewel in the rough
Send a message via AIM to Kalbintion Send a message via MSN to Kalbintion Send a message via Yahoo to Kalbintion
[CODE] [VB6] Bit XOR Function

These functions below take a binary string ... [0's and 1's] and inverts the bit

first one gives the binary string back inversed, the second one gives the binary string back inversed, then transformed into hex

i needed this function because if statements i didnt like to do a quick chk to see if a value is 1 or 0, i used this in conjuction with a chkbox setting the others to the opposite of the one selected....useful instead of an if statement --- also useful if ur used to assembly and the "XOR" processor command flipping data into the inverse XD ...

Code:
'// Function takes a binary string, and inverts the values
'   then gives it back out as a binary
'   chk function underneath for hex answer
Private Function bitXOR(Val As String) As String
    For i = 1 To Len(Val)
        Select Case Mid$(Val, i, 1)
            Case 0:
                bitXOR = bitXOR & "1"
            Case 1:
                bitXOR = bitXOR & "0"
        End Select
    Next
End Function

Private Function hbitXOR(Val As String) As String
    For i = 1 To Len(Val)
        Select Case Mid$(Val, i, 1)
            Case 0:
                hbitXOR = hbitXOR & "1"
            Case 1:
                hbitXOR = hbitXOR & "0"
        End Select
    Next
    hbitXOR = Hex(Val(hbitXOR))
End Function
Reply With Quote
D3scene
Welcome to D3scene - probably the best location for all Gamers.

To participate in our friendly environment you have to register. After completing registration you will have full access to all threads and features. We care about members and try to make your stay as pleasant as possible. We are unique with the following feature for members - you will not see a single Advertisement!


The best: registration is completely free. It will not cost you a single penny or harm you in any way. You will lose nothing except 1 minute of your time. So why not register? We would be happy to see you around!
  #2  
Old 01-30-2009, 02:28 PM
Rufus's Avatar
Member

 
Join Date: Feb 2008
Location: 0xDEADBEEF
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Reputation: 91
Rep Power: 2
Rufus will become famous soon enough
if you did one of these for the most common commands, it could turn out to be useful
Reply With Quote
D3scene
Welcome to D3scene - probably the best location for all Gamers.

To participate in our friendly environment you have to register. After completing registration you will have full access to all threads and features. We care about members and try to make your stay as pleasant as possible. We are unique with the following feature for members - you will not see a single Advertisement!


The best: registration is completely free. It will not cost you a single penny or harm you in any way. You will lose nothing except 1 minute of your time. So why not register? We would be happy to see you around!
Reply

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT +1. The time now is 12:53 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 ©2009, Crawlability, Inc.
vBulletin style developed by Transverse Styles