473,394 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Visual Studio 2008

I built a program of Visual Studio 2008. It's all right.

But I have a little problem, i got a little Debugg how to fix it ?



It's my function:
Expand|Select|Wrap|Line Numbers
  1. Private Function BinaryNbr(ByVal calc As Long) As String
  2.         Dim value As String, exp As Integer
  3.         value = "00000000000000000000000000000000"
  4.         Do
  5.             If calc And ExpUp(exp) Then
  6.                 Mid$(value, 32 - exp, 1) = "1"
  7.                 calc = calc Xor ExpUp(exp)
  8.             End If
  9.             exp = exp + 1
  10.         Loop While calc
  11.         BinaryNbr = Mid$(value, 33 - exp)
  12.     End Function
  13.  
Jan 29 '10 #1
3 1213
tlhintoq
3,525 Expert 2GB
The error is telling you that it is not possible to cast the string to a number.
How would you? What would be the numerical value of the word "cat"? Would a "cat" be equal to 7, a "dog" be equal to 9, a "horse" be equal to 14?

You can try to convert a string such as "4" to a number 4, but if the string cannot be converted then it throws and exception, so you put it into a try/catch block.

Convert.ToDecimal(string VariableName);

http://msdn.microsoft.com/en-us/libr...todecimal.aspx
Jan 29 '10 #2
Can you fix it in my code, because I couldn't do this 3 days... ?
Jan 29 '10 #3
tlhintoq
3,525 Expert 2GB
A) I don't write in VB. I am a C# guy.
B) I've already pointed you to the function you need. Take 5 minutes to experiment with it.

If you can't be bothered with learning or experimenting with a new function that you were already given then maybe it's time to tell your boss that you don't have the training to complete this project. It might be the nudge (s)he needs to get you some more training which can only further your career.

Either that or your company needs to quit underbidding qualified coders on projects that they don't have the expertise to handle - because it is unfair to their staff (you) to expect results they aren't prepared to produce. Nobody needs that kind of pressure placed upon them. It just makes people miserable.

Take a look at the link I sent you and the method that I already showed you. Experiment with it. Trial and error. I'm not saying take 3 days on it, but at least give it 2 hours. If you give it an honest effort and still can't get it, then post the code that you have tried and someone here should be able to help your understanding of the function so that you *learn* instead of blindly *copy/paste*.
Jan 29 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: =?Utf-8?B?SmFzb24gQS4gSmVuc2Vu?= | last post by:
I have a MSDN Subscription expiring this month but really need Visual Studio 2008 when it comes out. I called customer service to find out but they don't know. They seemed to think it was a...
1
by: sundarvenkata | last post by:
Is multi-targeting possible using Visual Studio Express? If not, do I have any other options to target a 1.1 framework using Visual Studio Express? Thanks for your help, Sundar
9
by: =?Utf-8?B?RmxhdmVsbGUgQmFsbGVt?= | last post by:
Apparently the Java Conversion tool that used to be in Visual Studio 2005 is no longer supported in Visual Studio 2008. Anyone have any suggestions on how to convert a Java program to C# in Visual...
2
by: Nikolay Belyh | last post by:
1. Why does Visual Studio 2008 started ignoring //{NO_DEPENDENCIES} in resource.h? If I edit file "resource.h" _manually_, it rebuilds the whole solution. It worked just fine with Visual Studio...
4
by: lichaoir | last post by:
Can I develop asp.net 1.1 application in visual studio 2008? I've tried to find .net framework 1.1 in the project's properties window, but I can't find it! Please help! Thanks for your...
2
by: Cramer | last post by:
So, what is the relationship between Visual Studio and Visual Web Developer. I find a lot of documentation on MSDN that presents Visual Web Developer as it's own stand-alone product (which I'd...
5
by: =?Utf-8?B?QXJuZSBHYXJ2YW5kZXI=?= | last post by:
Does Visual Studio 2005 and Visual Studio 2008 work well together on a Vista computer? I am having some issues with Ajax development. Neither VS2005 nor VS 2008 work well since I installed Visual...
0
by: _Who | last post by:
I'm trying to free up some space on my system disk. In Add or Remove Programs I see: Microsoft Windows SDK for Visual Studio 2008 .NET Framework Tools Microsoft Windows SDK for Visual Studio...
1
by: Puja Patel | last post by:
hi all, am not sure if this is the right place for this post. I created a website on .net framework 2.0 using visual studio 2005 and web service software factory. I created all my business...
3
by: Johnson | last post by:
I'm not sure if this is an IIS 5.1 issue or ASP.NET issue, or Visual Studio 2008 issue -- thus posting to 3 groups. Please don't be offended. The problem I'm encountering is that Visual Studio...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.