How can I convert a text to integer
-
hi. how can I convert a string to integer? I'm doing a program in VB were you are required to input a mathematical formula in a single input box and value each of the integer. But when I use the Left command, the formula of the textbox are converted into string type and won't compute the value as in the formula indicated. I really need your help. thanks..
-
hi. how can I convert a string to integer? I'm doing a program in VB were you are required to input a mathematical formula in a single input box and value each of the integer. But when I use the Left command, the formula of the textbox are converted into string type and won't compute the value as in the formula indicated. I really need your help. thanks..
There is nothing built into VB.NET or the .NET Framework that's going to evaluate expressions typed into a textbox. You have to create your own expression parsing engine to break the input down into something you can do the math on, piece-by-piece. Google for "Reverse Polish Notation" for an intro to expression engines. There are certainly other implementations to do this, but RPN is good place to start.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
hi. how can I convert a string to integer? I'm doing a program in VB were you are required to input a mathematical formula in a single input box and value each of the integer. But when I use the Left command, the formula of the textbox are converted into string type and won't compute the value as in the formula indicated. I really need your help. thanks..
-
Hi, If U want to convert text in to integer then simply U can use it:-
dim s as string dim i as integer s="200" i=val(s) 'This function converts the string in integer
Best Of Luck:rose:Did you read the OP's question? He said the text box contains a "mathematical formula".
Upcoming FREE developer events: * Developer! Developer! Developer! 6 * Developer Day Scotland My website
-
hi. how can I convert a string to integer? I'm doing a program in VB were you are required to input a mathematical formula in a single input box and value each of the integer. But when I use the Left command, the formula of the textbox are converted into string type and won't compute the value as in the formula indicated. I really need your help. thanks..