Please support our VB.NET advertiser: Programming Forums
![]() |
•
•
Join Date: Sep 2004
Location: Overflow State
Posts: 183
Reputation:
Rep Power: 5
Solved Threads: 4
Welcome to the forums,
I have written a program called "Conversion" a while back. It does exactly what you are looking for and more:
It's an open source project. Well, back to your original question I see that you need it done in VB. My source code was written in C, but if you know how to convert C to VB, or anyone else that is a VB expert, that would be helpful.
Here is a look on how to convert Binary to Decimal:
*buf is your binary value in string format.
It's pretty much the syntax that will get you started. It's not hard to understand at all. I hope this gets you a head start, and good luck.
- Stack Overflow
I have written a program called "Conversion" a while back. It does exactly what you are looking for and more:
- Decimal to Hex
- Hex to Decimal
- Hex String to Decimal
- Decimal to Binary
- Binary to Decimal
- Float to Binary
- Ascii to Binary
- Binary to Ascii
It's an open source project. Well, back to your original question I see that you need it done in VB. My source code was written in C, but if you know how to convert C to VB, or anyone else that is a VB expert, that would be helpful.
Here is a look on how to convert Binary to Decimal:
#include <string.h> int btoi(char *buf) { // Create local variables int count, tmp; int retValue = 0; // Get length of string count = strlen(buf); // Go through string one byte at a time (backwards) for (i = 0; i <= count; i++) { // If a number '1' was found if (buf[count-i] == '1') { tmp = 1; for (j = 1; j < i; j++) tmp *= 2; retValue += tmp; } } // Return our decimal value return retValue; }
It's pretty much the syntax that will get you started. It's not hard to understand at all. I hope this gets you a head start, and good luck.
- Stack Overflow
Following the rules will ensure you get a prompt answer to your question. If posting code, please include BB [code][/code] tags. Your question may have been asked before, try the search facility.
IRC
Channel: irc.daniweb.com
Room: #c, #shell
IRC
Channel: irc.daniweb.com
Room: #c, #shell
•
•
Join Date: Jan 2005
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 0
I need some help converting flaot to binary, do you still have the converstion program lying around? thanks!!
•
•
•
•
Originally Posted by Stack Overflow
Welcome to the forums,
I have written a program called "Conversion" a while back. It does exactly what you are looking for and more:
- Decimal to Hex
- Hex to Decimal
- Hex String to Decimal
- Decimal to Binary
- Binary to Decimal
- Float to Binary
- Ascii to Binary
- Binary to Ascii
•
•
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,859
Reputation:
Rep Power: 8
Solved Threads: 116
Public Function B2D(BinVal As String) As String
Dim iVal#, temp#, i%, Length%
Length = Len(BinVal)
For i = 0 To Length - 1
temp = CInt(Mid(BinVal, Length - i, 1))
iVal = iVal + (temp * (2 ^ i))
Next i
B2D = iVal
End Function•
•
Join Date: Feb 2005
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
Originally Posted by Stack Overflow
Welcome to the forums,
I have written a program called "Conversion" a while back. It does exactly what you are looking for and more:
- Decimal to Hex
- Hex to Decimal
- Hex String to Decimal
- Decimal to Binary
- Binary to Decimal
- Float to Binary
- Ascii to Binary
- Binary to Ascii
It's an open source project. Well, back to your original question I see that you need it done in VB. My source code was written in C, but if you know how to convert C to VB, or anyone else that is a VB expert, that would be helpful.
Here is a look on how to convert Binary to Decimal:
*buf is your binary value in string format.#include <string.h> int btoi(char *buf) { // Create local variables int count, tmp; int retValue = 0; // Get length of string count = strlen(buf); // Go through string one byte at a time (backwards) for (i = 0; i <= count; i++) { // If a number '1' was found if (buf[count-i] == '1') { tmp = 1; for (j = 1; j < i; j++) tmp *= 2; retValue += tmp; } } // Return our decimal value return retValue; }
It's pretty much the syntax that will get you started. It's not hard to understand at all. I hope this gets you a head start, and good luck.
- Stack Overflow
and hex to Date conversion programmer. if any one have it send it this id pthulasiram@rediffmail.com or pthulasiram@yahoo.com. send it pls.
•
•
Join Date: Feb 2005
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
i need one coversion programmer in C for hex to Decimal conversion.
than one more programmer i need for hex to Date conversion in C.
this this hex value - 335455C8. this value convert to Date. the date count start for . 1.1.1970 02:00:00.
can any one u send me my id for pthulasiram@rediffmail.com or pthulasiram@yahoo.com.
than one more programmer i need for hex to Date conversion in C.
this this hex value - 335455C8. this value convert to Date. the date count start for . 1.1.1970 02:00:00.
can any one u send me my id for pthulasiram@rediffmail.com or pthulasiram@yahoo.com.
•
•
Join Date: May 2006
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
Originally Posted by Stack Overflow
Welcome to the forums,
I have written a program called "Conversion" a while back. It does exactly what you are looking for and more:It's an open source project. Well, back to your original question I see that you need it done in VB. My source code was written in C, but if you know how to convert C to VB, or anyone else that is a VB expert, that would be helpful.
- Decimal to Hex
- Hex to Decimal
- Hex String to Decimal
- Decimal to Binary
- Binary to Decimal
- Float to Binary
- Ascii to Binary
- Binary to Ascii
Here is a look on how to convert Binary to Decimal:
*buf is your binary value in string format.#include <string.h> int btoi(char *buf) { // Create local variables int count, tmp; int retValue = 0; // Get length of string count = strlen(buf); // Go through string one byte at a time (backwards) for (i = 0; i <= count; i++) { // If a number '1' was found if (buf[count-i] == '1') { tmp = 1; for (j = 1; j < i; j++) tmp *= 2; retValue += tmp; } } // Return our decimal value return retValue; }
It's pretty much the syntax that will get you started. It's not hard to understand at all. I hope this gets you a head start, and good luck.
- Stack Overflow
Hi
i need help for converting binary to ascii
:-( ![]() |
Similar Threads
Other Threads in the VB.NET Forum
- Google's AdWords Conversion Tracking System (Pay-Per-Click Advertising)
- Are You Using These Keyword Selection Guidelines to Improve Website Conversion Rates? (Search Engine Optimization)
- Need help with this conversion program (C++)
- code conversion from c\c++ to java (C++)
- Java to C# Conversion (C#)
- project conversion (C++)
- Tower to Rack conversion Kit (Networking Hardware Configuration)
- Pounds to Grams Conversion (C++)
Other Threads in the VB.NET Forum
- Previous Thread: A simple question
- Next Thread: Error Querying LDAP
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode