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

Casting Question - I think!! Help please

I have a string called jkl which currently is "3 * 4 + xyz"
I also have an integer: xyz = 5

How do get an integer that equals 17 (3 times 4 plus 5.)

In other, more specifically:

dim jkl as string = "3 * 4 + xyz"
dim xyz as integer = 5

dim answer as integer = ????????????????????????

Thanks much in advance.

Nov 21 '05 #1
3 923

Dim jkl As String
Dim xyz As Integer = 5
Dim ans As Integer
ans = CInt(12 + xyz)

"Alex Pierson" wrote:
I have a string called jkl which currently is "3 * 4 + xyz"
I also have an integer: xyz = 5

How do get an integer that equals 17 (3 times 4 plus 5.)

In other, more specifically:

dim jkl as string = "3 * 4 + xyz"
dim xyz as integer = 5

dim answer as integer = ????????????????????????

Thanks much in advance.

Nov 21 '05 #2
Alex Pierson schrieb:
I have a string called jkl which currently is "3 * 4 + xyz"
I also have an integer: xyz = 5

How do get an integer that equals 17 (3 times 4 plus 5.)

In other, more specifically:

dim jkl as string = "3 * 4 + xyz"
dim xyz as integer = 5

dim answer as integer = ????????????????????????

Thanks much in advance.

You must use a compiler to compile this code.

http://msdn.microsoft.com/library/en...elanguages.asp
Armin
Nov 21 '05 #3
I saw a mathematical expression parser over at CodeProject the other day
that could handle this and a lot more...

"Alex Pierson" <ar******@charter.net> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I have a string called jkl which currently is "3 * 4 + xyz"
I also have an integer: xyz = 5

How do get an integer that equals 17 (3 times 4 plus 5.)

In other, more specifically:

dim jkl as string = "3 * 4 + xyz"
dim xyz as integer = 5

dim answer as integer = ????????????????????????

Thanks much in advance.

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Al Tobey | last post by:
DBIx::Config is a new module I've written to simplify connecting to databases and passing the resulting handles between packages. Before uploading to CPAN, I'd like to see what people around here...
1
by: KK | last post by:
Hi All i have an interface like this in file Interface.h __gc __interface IParam { }; My implementation class is like this public __gc class Param : IParam {
35
by: ytrama | last post by:
Hi, I have read in one of old posting that don't cast of pointer which is returned by the malloc. I would like to know the reason. Thanks in advance, YTR
44
by: Agoston Bejo | last post by:
What happens exactly when I do the following: struct A { int i; string j; A() {} }; void f(A& a) { cout << a.i << endl;
1
by: Remco | last post by:
Hi, Let me try to simply explain my questions. I've created a portal site with different types of users, e.g. Portal Administrators and Normal Users. One base class SessionUser (has a enum...
12
by: 6tc1 | last post by:
Hi all, I just discovered a rounding error that occurs in C#. I'm sure this is an old issue, but it is new to me and resulted in a fair amount of time trying to track down the issue. Basically...
7
by: S. Lorétan | last post by:
Hi guys, Sorry for this stupid question, but I don't know why it isn't working. Here is my (example) code: namespace Test { class A { public string Label1; }
7
by: William S Fulton | last post by:
I'm looking for the name of the following casting style in order to do some reading around on it and why it is sometimes used. unsigned long long ull = 0; void * ptr = 0; ull = *(unsigned...
4
by: Wally Barnes | last post by:
Can someone help a poor C++ programmer that learned the language before there was a standard lib .. etc ? Basically I have two classes that look something like below: template <class T>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.