![]() |
Binary Conversion In VB
Useful Binary Conversion. This program convert Binary to text and text to binary. This program has one Form1 (Main.frm), textbox (Text1.Text), two button, (cmdConvtoBin and cmdConvtoText) and a module1 (Binary.bas)
- Form Command Code: VB
- Modules script Code: VB
|
Re: Binary Conversion In VB
Hi vishal sharma,
I was looking for some codes that would convert binary to text and vice versa and have come to your site. I must say this is what i'm looking for. However, i'd like to ask you a question. with the convertbin sub you have there, there seems to be some missing info. for example, Code: VB
Thank you in advance |
Re: Binary Conversion In VB
thank u for the reply
|
Re: Binary Conversion In VB
associates probably there is an operator missing. add division operator there and that would solve the problem.
|
Re: Binary Conversion In VB
i still cant get this to work
if anyone has it working, could you please just post the whole, complete module code thanks |
Re: Binary Conversion In VB
replace the module with the following.
module- replacement Code:
Public MainText As String 'this is the text from the textbox |
Re: Binary Conversion In VB
ok it works, sorta.....i translated 'hello' into binary and it gave me '1010100010100101100101001001010010010001'
which, when translated back, comes to be '¨¥””‘' and on a web based converter, it comes out to be '¨¥””‘' so i experimented with the web based one, and it turns out in the program, the Binary to TeXt works perfectly, but the Text to Binary has something wrong with it... anyone know whats up? thanks & cheers |
Re: Binary Conversion In VB
anyone...know whats going on?
|
Re: Binary Conversion In VB
Will this work with numbers or along text i.e Is is just characters? Or numbers too. if not can someone post a code that would do basic integer or real number conversion to and fro binary.
|
Re: Binary Conversion In VB
The operator between DD and 2 should be a backslash, not a slash. Presumably this is dropped by the site logic. Interestingly (in VS2005) 13 rounds to 6, but 3 rounds to 2. Not sure why the rounding is in opposite directions for 6.5 and 1.5.
In VS2005 you can't just have Public Sub ConvertBin(TheString As String) - it insists on inserting a ByVal, which means you can't modify the string. So you have to force ByRef. Code:
Backslash test \ there should be one between "test" and "there" |
| All times are GMT +5.5. The time now is 15:40. |