473,320 Members | 1,884 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,320 software developers and data experts.

How to replace an Integer value with a String value?

Hey, everyone first time so bear with me if something looks odd. Im working with a file and need to set the value of a variable from an integer(which it is in the file) to a String(to be consoled out). Im recieving an error in the if statments. Am I on the right track or is there another way of doing it? Any help would be great. Att: is the vb program of what i have so far.Thanks
Attached Files
File Type: txt vb3.txt (2.7 KB, 391 views)
Dec 8 '10 #1
2 1906
You've got quite a few problems here. You're dimensioning dStateID as an integer, and then assigning a string value to it. That will give you an error every time. Plus, the dStateid variable is local to the initialization procedure, which means it will never be seen by the rest of the program.

Also, you're combining a case statement with an if-else, which is counter productive and confusing. Just make each decision a case. Look up the help on select case to get the syntax right, since using "select case true" makes no sense at all.
Dec 8 '10 #2
Thanks For the reply.I understand that I am getting an error but, i really don't know how to write it. The problem is that in the file, the dstateid variable is an integer and my professor wants me to console it to the name "Illinois" and 168 to "Ohio" etc.(see the 'If' 'Then' statements). This is what I'm trying to accomplish. I have removed the dstateid from local to the main module and edited the Select Case statements to IF ones.
Attached Files
File Type: txt VBedit.txt (2.5 KB, 386 views)
Dec 10 '10 #3

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

Similar topics

1
by: Wee | last post by:
String.value.length and String.value doesn't work together in a single function in IE. I've no problem running either of this, but not together at the same time. var...
13
by: sam | last post by:
Hi, Does STL has Integer class? I want to convert an integer to string. Of course I can use sprintfs C API, but I m wondering whether STL has Integer class to be utilsed. Thanks Sam.
9
by: Henrik | last post by:
In Java you can write something like this. Does anyone know how to do this in javascript? "byte b=Integer.parseInt(int value or String).byteValue;"
6
by: compboy | last post by:
Can anyone help me about this. I have been trying all the ways I knew and I could find but just didnt work. I have tried: using itoa but it says that it doesnt have that function. and...
5
by: noddy | last post by:
What I thought was a string value does not seem to be recognised as such. In the following code I extract the string "foo" from an array and put it into the variable up0 But on checking I find...
1
Jugmike
by: Jugmike | last post by:
Hi I want to have a format while conversion from integer to string i want that string has 5 digits and if integer has 3 digits only then it is represented like 00122. There is programming which i...
3
by: Krupa Kiran | last post by:
Hi i have function in script. I did a small calculation in that function when i try to pass a value to in Field thet only passes integer value. But i need to pass both String and the integer value....
4
by: mthread | last post by:
Hi, I would like to know the method to convert integer to string. Thanx in advance.
5
by: pradeep | last post by:
Hello friends: I know some people here don't like to answer C++ questions, but I believe this is really about the underlying C code. Anyway I have posted as well to the other group someone...
0
by: Jim Langston | last post by:
pradeep wrote: Not big enough by far and disappears once IntToString finishes. No reason to have to do this. sprintf( buf, "%d", i ); would also work, although there are hte other...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.