-
Oct 29th, 2013, 05:27 PM
#1
Thread Starter
Junior Member
[RESOLVED] How do I return groups of numbers or characters from a string?
I'm writing a graphing calculator right now, and I need to be able to read an equation (i.e. [y1= 6x/3x^2] or [y2= (2x + 4)(3 - 2x^2)]) and return it as a very simplified equivalent function (i.e. [y1= 2x^-1] or [y2= -4x^3 - 8x^2 + 6x + 12]). I just need to know how to go about identifying the groups of numbers/operators/variables, and it should be much easier from there.
Also, if the coefficient, variables, and exponents could be returned as separate variables, this would be a ton easier. Thanks!
EDIT: I'm writing this as a callable function like this, where 'eqtn' is only the right side of an equation, like this: (the bold) y1= 3x + 2
Code:
Private Function getEquation(ByRef eqtn As String)
End Function
Thank you!
Last edited by DinosaurusRex; Oct 29th, 2013 at 05:35 PM.
-
Oct 29th, 2013, 05:41 PM
#2
Re: How do I return groups of numbers or characters from a string?
-
Oct 29th, 2013, 05:56 PM
#3
Re: How do I return groups of numbers or characters from a string?
-
Oct 29th, 2013, 06:20 PM
#4
Thread Starter
Junior Member
Re: How do I return groups of numbers or characters from a string?
dbasnett,
Unfortunately, I'm pretty new to VB, having started only a few months ago. I've gotten my way around it though, (even writing a ten-line factorizing program from scratch! (I don't know how impressive this is, but it was pretty cool to me)) and am really just trying to teach myself as I go and encounter new problems. I did take a look at the article you linked, but it's beyond me. Thanks!
Last edited by DinosaurusRex; Oct 29th, 2013 at 06:24 PM.
-
Oct 29th, 2013, 06:22 PM
#5
Thread Starter
Junior Member
Re: How do I return groups of numbers or characters from a string?
4x2y,
Thanks, I feel like this will come in very handy. Is there anything I need to import into my code for this to work though? I can't declare variables as an "evaluator", because it isn't supported as a type by default.
-
Oct 29th, 2013, 06:40 PM
#6
Re: How do I return groups of numbers or characters from a string?
Add the two files Evaluator.vb and EvalFunctions.vb to your project
-
Oct 29th, 2013, 08:09 PM
#7
Thread Starter
Junior Member
Re: How do I return groups of numbers or characters from a string?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|