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
How to replace an Integer value with a String value?
Collapse
X
-
Tags: None
-
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. -
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 FilesComment
Comment