Login Register


[HELP]Adding code from outside filter_list
Author
Message
[HELP]Adding code from outside #1
Hi Smile
I didn't know how to name it, so I tried this title Smile Biggrin

Well... I have this little idea of a math problem brute-forcer.
I was thinking about it how I would do it and I faced a problem.

How can I do in VB that it will count something, what user inputs?

Example: The program has just 1 button: Calculate. And some textbox, I have the feeling I will need richtextbox for thisTongue

Anyway, the user will write in the textbox: 1 + 1 and he hits calculate, the program will return "2"

It should work for any math operation: (1 + 1) * ( 2 - 1)
(4 - 1) / 2..........


Thanks a lot!!!

Have a nice day!!!!
Staff will never ever ask you for your personal information.
We know everything about you anyway.

Reply

RE: [HELP]Adding code from outside #2
Lol, you won't believe me but I was thinking about making this 2 days ago. I've formatted and switched to 7-64bit, so wait for me to install stuff and test the code I have in mind.
[Image: rytwG00.png]
Redcat Revolution!

Reply

RE: [HELP]Adding code from outside #3
(02-07-2011, 12:14 PM)Coder-san Wrote: Lol, you won't believe me but I was thinking about making this 2 days ago. I've formatted and switched to 7-64bit, so wait for me to install stuff and test the code I have in mind.

yay my mind-set is coming near to a pro Tongue (a wish)

I tried to fool the program by adding " -code- but ofc it doesn't work...

Thanks Smile meanwhile I'll try to come up with something too Tongue
Staff will never ever ask you for your personal information.
We know everything about you anyway.

Reply

RE: [HELP]Adding code from outside #4
Couldn't test yet, but the other code I tested in VB6 suggest that what I thought probably won't work.
I was trying to reconstruct what Msgbox does.

For example if you enter this:

MsgBox((2+2) * (90-80))

you will get 40.
However it seems tricky to reconstruct. Good luck with your method though.
[Image: rytwG00.png]
Redcat Revolution!

Reply

RE: [HELP]Adding code from outside #5
(02-08-2011, 05:52 PM)Coder-san Wrote: Couldn't test yet, but the other code I tested in VB6 suggest that what I thought probably won't work.
I was trying to reconstruct what Msgbox does.

For example if you enter this:

MsgBox((2+2) * (90-80))

you will get 40.
However it seems tricky to reconstruct. Good luck with your method though.

I was reading a bit about it and it seems to be very difficult for managed language... and if it would be done, it would be more like a compiler then application...

I will try to mix it with lua, since lua can calculate with strings that contain only numbers etc...
But I'm not so sure how you call lua from vb Biggrin

thanks tho Smile
Staff will never ever ask you for your personal information.
We know everything about you anyway.

Reply

RE: [HELP]Adding code from outside #6
I found this C# code on Stack Overflow:

Code:
var result = new DataTable().Compute("2-3/4*12", null);

VB code should be:

Code:
Dim result As Double = New DataTable.Compute("2-3/4*12", null)
[Image: rytwG00.png]
Redcat Revolution!

Reply

RE: [HELP]Adding code from outside #7
(02-09-2011, 08:54 AM)Coder-san Wrote: I found this C# code on Stack Overflow:

Code:
var result = new DataTable().Compute("2-3/4*12", null);

VB code should be:

Code:
Dim result As Double = New DataTable.Compute("2-3/4*12", null)

wow awesome!!! Thanks!!!
Staff will never ever ask you for your personal information.
We know everything about you anyway.

Reply







Users browsing this thread: